goto statement

Hello all,

i know it's frowned upon , but I'm going to use a goto statement, because I need to break out of quite a few nested 'for' loops. If I do something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
int a;
LOOP:
for (a=0; a<100; a++)
{
 ....
 ..... 
 .....
 for (....)
 {
  if (condition)
  {goto LOOP;}
 }
}



Will a be incremented when I make the jump?

Thanks!
No.
Peter's right, but it wouldn't matter anyway even if it was because you'll be setting it to 0 immediately at the start of that for loop.
No, it wiil not bacause the controil has not reached the end of the loop.
Last edited on
... and yes, it is frowned upon.
Topic archived. No new replies allowed.