6.8.5.3 The for statement

Previous Table of Contents

1760 The statement

        for ( clause-1 ; expression-2 ; expression-3 ) statement

behaves as follows:

1761 The expression >expression-2 is the controlling expression that is evaluated before each execution of the loop body.

1762 The expression expression-3 is evaluated as a void expression after each execution of the loop body.

1763 If clause-1 is a declaration, the scope of any variables it declares is the remainder of the declaration and the entire loop, including the other two expressions;

1764 it is reached in the order of execution before the first evaluation of the controlling expression.

1765 If clause-1 is an expression, it is evaluated as a void expression before the first evaluation of the controlling expression.134)

1766 Both clause-1 and expression-3 can be omitted.

1767 An omitted expression-2 is replaced by a nonzero constant.

Next

Created at: 2005-06-29 02:19:03 The text from WG14/N1124 is copyright © ISO