Name

continue statement — Reiterates a loop statement

Synopsis

               statement := continue ;

The continue statement iterates a loop statement without executing the rest of the loop body. Control passes directly to the loop condition in a do or while loop or to the iterate expression in a for loop. You cannot use continue outside of a loop statement.

Example

while (getline(cin, line)) {
  if (line.empty(  ))continue;
  parse(line);
  do_more_stuff(  );
};

See Also

break, do, for, statement, while, Chapter 4

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.