daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn do_stuff<'a>(mut x: &'a i32, y: &'a i32) {
  2.     println!("{} {}", x, y);
  3.     x = y;
  4.     println!("{} {}", x, y);
  5. }
  6.  
  7. fn main() {
  8.    let a = 5;
  9.    let b = 6;
  10.    
  11.    let s = &a;
  12.    let t = &b;
  13.    
  14.    println!("{} {} {} {}", a, b, s, t);
  15.    
  16.    do_stuff(s, t);
  17.    
  18.    println!("{} {} {} {}", a, b, a, t);
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top