It continueaffects the next cycle - the second for. There are two ways to go directly to while:
gotoalthough it is sometimes βconsidered harmfulβ, this is perhaps the main reason it still exists.return
To illustrate the latter:
while (..)
{
DoSomething(..);
}
void DoSomething(..) {
for (...; ...;...)
for(...;...;...)
if ( )
{
...
return;
}
}
and first:
while (..)
{
for (...; ...;...)
for(...;...;...)
if ( )
{
...
goto continueWhile;
}
continueWhile:
{ }
}
source
share