for loop

for loop

Executes a loop.

Used as a shorter equivalent of while loop.

Syntax

for ( init_clause ; cond_expression ; iteration_expression ) loop_statement

Explanation

Behaves as follows:

  • init_clause may be an expression or a declaration
    • If it is an expression, it is evaluated once, before the first evaluation of cond_expression and its result is discarded.
    • 登录查看完整内容