//P-6: scope resolution operator ::
#include <iostream.h>
#include <conio.h>
int n = 100;
void main()
{
int n = 50;
clrscr();
{
int n = 25;
cout << "\nblock -1" << endl;
cout << "N = " << n << endl;
cout << "::N = " << ::n << endl;
}
{
int n = 10;
cout << "\nblock -2" << endl;
cout << "N = " << n << endl;
cout << "::N = " << ::n << endl;
}
cout << "\nmain function" << endl;
cout << "N = " << n << endl;
cout << "::N = " << ::n << endl;
getch();
}
Comments
Post a Comment