Scope of Variables, Example 1
•
int main
•
{
•
{
•
int x = 0;
•
}
•
cout << x << endl;
•
return 0;
•
}
This program will not compile because the compiler will detect that there is no such variable as x by the time the cout occurs.