Copyright © 1996, 1997 Lucent Technologies Inc. All rights reserved.

9.6 for statement

The for statement has the form


labelopt for ( expression-1opt ; expression-2opt ; expression-3opt ) statement
It is equivalent to

expression-1 ; while ( expression-2 ) { statement expression-3 ; }
in the absence of continue or break statements. Thus (just as in C), the first expression is an initialization, the second a test for starting and continuing the loop, and the third a re-initialization for subsequent travels around the loop.

05/Jun/97