Skip to content

Instantly share code, notes, and snippets.

@isaacd9
Created October 21, 2018 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacd9/0bacb0644f8e2e2e6740908a26d0fe08 to your computer and use it in GitHub Desktop.
Save isaacd9/0bacb0644f8e2e2e6740908a26d0fe08 to your computer and use it in GitHub Desktop.
fn inc(num: &mut i32) {
*num += 1;
}
fn main() {
let mut x: i32 = 100;
inc(&mut x);
println!("Got {}", x)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment