Compiler Warning (level 1) C4258 (Windows CE 5.0)

Send Feedback

'variable' : definition from the nearest for loop is ignored;
the definition from the nearest enclosing scope is used

Under /Ze and /Zc:forScope, variables defined in a for loop go out of scope after the for loop ends. This warning occurs if a variable with the same name as the loop variable, but defined in the enclosing loop, is used again in the scope containing the for loop. For example:

void main() {
int i;
{
for (int i =0; i < 1; i++)
;
i = 20;// i (in for loop) has gone out of scope
}
}

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.