Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (29 sloc) 733 Bytes
int main() { // scope 1, nestlevel 1
print("1..5\n");
int x = 1;
print("ok ");
print(x);
print(" - function-level scope\n");
{ // scope 2, nestlevel 2
int y = 2;
print("ok ");
print(y);
print(" - nested scope with var y.\n");
}
{ // scope 3, nestlevel 2
int y = 3;
print("ok ");
print(y);
print(" - other nested scope with var y.\n");
}
{ // scope 4, nestlevel 2
int y = 4; // ok,
print("ok ");
print(y);
print(" - yet another nested scope with var y.\n");
}
int y = 5;
print("ok ");
print(y);
print(" - back in function-level scope\n");
}