contents   index   previous   next



break

 

Break and continue are used to control the behavior of the looping statements: for, switch, while, and do {...} while. The break statement terminates the innermost loop of for, while, or do statements. The program resumes execution on the next line following the loop. The following code fragment does nothing but illustrate the break statement.

 

for(;;)

{

   break;

}

 

The break statement is also used at the close of a case statement, as shown below. See switch, case, and default.

 


continue