Skip to content

Instantly share code, notes, and snippets.

@ashiato45
Created March 17, 2017 11:10
Show Gist options
  • Save ashiato45/c009cd2e8f6929c18c4a7f0e4e95ec48 to your computer and use it in GitHub Desktop.
Save ashiato45/c009cd2e8f6929c18c4a7f0e4e95ec48 to your computer and use it in GitHub Desktop.
fn f(a: &mut i32){
*a += 1;
}
fn main() {
let mut a: i32 = 3;
println!("Hello, world! The number is {}", a);
f(&mut a);
println!("The number is {}", a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment