Dr. Dobb's Journal September 1998
(a)
for (int i = 0; i < 5; i++) {
// i is in scope
}
// i is no longer in scope
(b)
for (int i = 0; i < 5; i++) {
// ...
}
if (i == 5) // OK with old C++, error with Standard C++
(c)
int i; // outer i
if (abc) {
for (int i = 0; i < 5; i++) {
// ...
}
if (i == 5) { // inner i with old C++, outer i with Standard C++
// ...
}
}