Summary

Section 5.2 Essentials of Counter-Controlled Iteration

  • Counter-controlled iteration (p. 160) requires a control variable, the initial value of the control variable, the increment by which the control variable is modified each time through the loop (also known as each iteration of the loop) and the loop-continuation condition that determines whether looping should continue.

  • In C++, a variable declaration that also reserves memory is a definition (p. 161).

Section 5.3 for Iteration Statement

  • The while statement can be used to implement any counter-controlled loop.

  • The for statement (p. 161) specifies all the details of counter-controlled iteration in its header

  • When the for statement begins executing, its control variable is optionally ...

Get C++ How to Program, 10/e 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.