Break in a Loop
static int code = 0;
void funcWhileIfBreak (void)
{
while (code > 0)
{
if (code == 3)
{
break;
}
--code;
}
if (code == 0)
{
code++;
}
}
The break jumps to the end of the while statement and causes a knot (this is where the control flow crosses the boundary of another statement block, indicating unstructured code). In this case, once the break has jumped to the end of the while statement, the next part of the program - the if statement - is executed.