Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Blocks
- fn main(){
- let apple = 10;
- //Define block with {}
- {//Begin Block
- //The blocks are ISOLATED
- let pear = 12;
- println!("Apple = {}, Pear = {}", apple, pear);
- }//End Block
- //If you print this line you will have error
- //println!("Apple = {}, Pear = {}", apple, pear);
- }
- /*Result
- Apple = 10, Pear = 12
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement