thesis/tex/code/borrow.rs

11 lines
167 B
Rust
Raw Normal View History

2020-05-02 21:11:26 +03:00
fn say_hello(name: &String) {
println!("Hello {}!", name);
}
fn main() {
let name = String::from("Marko");
say_hello(&name);
println!("{}", name);
}