daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Mar 24th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Blocks
  2. fn main(){
  3.   let apple = 10;
  4.   //Define block with {}
  5.   {//Begin Block
  6.     //The blocks are ISOLATED
  7.     let pear = 12;
  8.     println!("Apple = {}, Pear = {}", apple, pear);
  9.   }//End Block
  10.   //If you print this line you will have error
  11.   //println!("Apple = {}, Pear = {}", apple, pear);
  12. }
  13. /*Result
  14. Apple = 10, Pear = 12
  15. */
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