keyword for

From Cppwiki

Jump to: navigation, search


for is a keyword of the C and C++ languages. It forms a loop statement.

Syntax:

 for(init-statement; check-statement; increment-expr)
   body-statement
  • init-statement declares one or more variables of a single type, with initial values.
  • check-statement computes a boolean value which determines whether body-statement will be executed.
  • incr-statement modifies variable values for the next loop iteration.
Personal tools