... outputs this variable to show that it hides x
in the outer block of main
as well as the global x
. When the block exits, the variable x
with value 7 is destroyed automatically. Next, line 25 outputs the local variable x
in the outer block of main
to show that it’s no longer hidden.
Get C++ How to Program, 10/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.