
|
Continue the execution at the statement after the given label. Note that a return statement will not continue the execution at the statement after the goto statement; return is not affected by goto.
Syntax:
goto Label; // ... Label: // ... goto Label;
Example of using a goto as a replacement for break statement:
for (i = 0; i < 3; i = i + 1)
{
if (j == 42)
{
goto AfterForLoop;
}
}
AfterForLoop:
// This line is reached after "for" loop is done, or when j == 42.