The continue Statement

The continue statement is the opposite of the break statement. It passes control to the next iteration of the smallest enclosing do, for, or while statement in which it appears.

This statement is often used to return to the start of a loop from within a deeply nested loop.

The following example illustrates continue:

while( c != 'Q' )

{

/* Some C statements here*/

if( c == 0x20 )

continue; /* Skip rest of loop */

/* More C statements here */

}

In the example, the continue statement skips to the next iteration of the loop whenever c equals 0x20, the ASCII value for a space character.