G
Gani tpt
Guest
I am using many for loops. In some cases i want to break and go to specific loop.
How to do that..
below is example
int countA = 30;
int countB = 100;
int countC = 50;
for (i=0; i<= countA; i++)
{
for (j=0; j<=countB; j++)
{
for (k=0; k<=countC; k++)
{
if (condition) // this will be true, then go to "i" loop for the next iteration
goto LoopFirst // it should goto "i" loop
break;
}
}
LoopFirst: // it should goto "i" loop
}
can any one tell me, above condition will work...?
Continue reading...
How to do that..
below is example
int countA = 30;
int countB = 100;
int countC = 50;
for (i=0; i<= countA; i++)
{
for (j=0; j<=countB; j++)
{
for (k=0; k<=countC; k++)
{
if (condition) // this will be true, then go to "i" loop for the next iteration
goto LoopFirst // it should goto "i" loop
break;
}
}
LoopFirst: // it should goto "i" loop
}
can any one tell me, above condition will work...?
Continue reading...