Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main() {
- auto {
- a = 2 + 3;
- x = new X();
- {
- int b = a + 5;
- }
- //here b is out of scope!
- //But if i declare b using 'auto' in this way:
- auto {
- b = a + 5;
- }
- new_var = b + a; //b is visible
- {
- auto example = 2;
- }
- //here example is out of scope!
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement