Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

any way to fix this lousy for loop?

Name: Anonymous 2007-07-26 18:16 ID:fISZ2I3i

This doesn't work, but I want to do something like this:


for(int i = 0, bool s = true; ..... ; .....)
{
......;
}


That is,
1) I want to declare two variables
2) I want them to only have scope of the for loop, and
3) I want them to be initialized only once, not every pass through the loop. 

Is there any way to do it besides using awesome goto statements or wrapping the whole loop in braces and declaring i and s there?

Name: Anonymous 2007-07-26 19:25 ID:hlmyd1hz

If the variables were of the same type, doing
for(int i = 0, j = 10;...
works, otherwise, refer to >>1.

>>2
Pretty sure it's C++

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List