Skip to content

Instantly share code, notes, and snippets.

@ashiato45
Last active March 17, 2017 11:10
Show Gist options
  • Save ashiato45/2aa7774247fa8417d978ce04f3dffea7 to your computer and use it in GitHub Desktop.
Save ashiato45/2aa7774247fa8417d978ce04f3dffea7 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