Created
March 17, 2017 11:12
-
-
Save ashiato45/8c69702ad2d51aaca7270c118686f1cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn f(a: &mut i32, b: &i32){ | |
*a += *b; | |
} | |
fn main() { | |
let mut a: i32 = 3; | |
println!("Hello, world! The number is {}", a); | |
{ | |
let b: i32 = 2; | |
f(&mut a, &b); | |
println!("The number is {}", a); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment