Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  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. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement