20 cycle control

1, for the control loop

  ① for (loop variable initialization; cycling conditions; iteration loop variable) {

      Cycle operation;

    }

  ② represents a return loop condition is true (non-zero) false (0) expression

  ③for (; loop judgment condition;) and variable initialization iteration may not write (write elsewhere), but both sides can not be omitted semicolon

  ④ The initial value may be a plurality of loop initialization statement, but not the same type required, and separated by commas, variable loop iteration may be a plurality of variable iteration statement, separated by commas. Such as:

    for(i=0,j=0 ; j<count ; i++, j+=2)

 

Guess you like

Origin www.cnblogs.com/shanlu0000/p/12343886.html