Im sure the current standard C++ states that variables declared in the initialization part of a for(;;) loop are local only to that loop.
But when applied to (my) MSVC++ 6, this is not the case, and the variable is within the same scope as the for(;;) loop.
Can anyone explain this? or is this because MSVC does not conform to the standard perhaps?Code:
for(int x=0;x<10;x++) cout<<x;
cout<<++x; //x is still known up to this point