-
September 26th, 2009, 02:43 AM
#1
question about the for loop
When debugging I noticed what happens around this construct:
for(something) if(something) do something;
do something else;
The second is interpreted as part of the loop, which contradicts what I thought previously: the loop is terminated with the first semicolon unless there are braces present.
I fixed it thus:
for(something) {if(something) do something;}
do something else;
but am still wondering why it acts that way, and whether the if expression has something to do with it.
-
September 26th, 2009, 10:36 AM
#2
Re: question about the for loop
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|