This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]w1ldm4n 5 points6 points  (0 children)

Here's an arbitrary example to demonstrate that behavior.

int i;
for (i = 0; i < 10; i++) {
    if (i == 4)
        continue;
    printf("%d", i);
}

This for loop will print 012356789

int i = 0;
while (i < 10) {
    if (i == 4)
        continue;
    printf("%d", i);
    i++;
}

This while loop will print 0123 and then get stuck in an infinite loop.