Look at this piece of code
int x = 1;
int main(int argc, char* argv[])
{
int x = 2;
{
int x = 3;
cout << x << endl;
cout << ::x;
}
getch();
return 0;
}
When i call x from within the block i’m getting 3. When i call ::x i’m getting 1. Is it possible to call x equal to 2 from within the block?
With cheating: