6.11. The continue Statement
continue statement causes the current iteration of the nearest enclosing loop to terminate. Execution resumes with the evaluation of the condition in the case of a while or do while statement. In a for loop, execution continues by evaluating the expression inside the for header.For example, the following loop reads the standard input one word at a time. Only words that begin with an underscore will be processed. For any other value, we terminate the current iteration and get the next input:
A continue can appear only inside a for, while, or do while loop, including inside blocks nested inside such loops.
string inBuf;
while (cin >> inBuf && !inBuf.empty()) {
if (inBuf[0] != '_')
continue; // get another input
// still here? process string ...
}
Exercises Section 6.11
Section 6.10 (p. 213) so that it looks only for duplicated words that start with an uppercase letter.