keyword continue

From Cppwiki

Jump to: navigation, search


The continue keyword causes program execution to skip the rest of a [[loop] body and check the loop condition.

Example:

 for(int index = 0; index < size; ++index) {
   if(!mycont[index]) {
     /* Item is in an invalid state, skip loop body */
     continue;
   }
 
   /* Code to process mycont[index] */
 }

See also: for, while, do, break

Personal tools