January 2014
Intermediate to advanced
736 pages
70h 43m
English
Figure C.14 takes a closer look at the for statement in Fig. C.13. The for’s first line (including the keyword for and everything in parentheses after for)—line 10 in Fig. C.13—is sometimes called the for statement header. The for header “does it all”—it specifies each item needed for counter-controlled repetition with a control variable. If there’s more than one statement in the body of the for, braces are required to define the body of the loop. If the loop-continuation condition is initially false, the program does not execute the for statement’s body—execution proceeds with the statement following the for.
Fig. C.14 | for statement header components.
Read now
Unlock full access