6.8.5.3 The for statement

Previous Table of Contents "New C Standard" commentary

1774 The statement

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

behaves as follows:

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

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

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

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

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

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

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

Next

Created at: 2008-01-30 02:39:44 The text from WG14/N1256 is copyright © ISO