6.8.5 Iteration statements

Previous Table of Contents "New C Standard" commentary


                while ( expression ) statement
                do statement while ( expression ) ;
                for ( expressionopt ; expressionopt ; expressionopt ) statement
                for ( declaration expressionopt ; expressionopt ) statement

1764 The controlling expression of an iteration statement shall have scalar type.

1765 The declaration part of a for statement shall only declare identifiers for objects having storage class auto or register.

1766 An iteration statement causes a statement called the loop body to be executed repeatedly until the controlling expression compares equal to 0.

1767 The repetition occurs regardless of whether the loop body is entered from the iteration statement or by a jump.DR268

1768 An iteration statement is a block whose scope is a strict subset of the scope of its enclosing block.

1769 The loop body is also a block whose scope is a strict subset of the scope of the iteration statement.

1770 DR268) Code jumped over is not executed.

1771 In particular, the controlling expression of a for or while statement is not evaluated before entering the loop body, nor is clause-1 of a for statement.


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