home *** CD-ROM | disk | FTP | other *** search
- // \EXAMPLES\EX0420.CPP
- #include <iostream.h>
-
- void main() {
- float x = 99.9; // x declared as a float in enclosing block
- {
- int x = 0; // x declared as an int in the enclosed block
- int y = 1;
- cout << "Here is x in the nested block: " << x << endl;
- }
- cout << "Here is x in outer block: " << x << endl;
- // y is not visible in the enclosing block
- }
-