Definition of A For loop:
for (parameter 1; parameter 2; parameter 3), parameter 1 is usually the initialization parameter, parameter 2 is the judgment, Parameter 3 is the operation of the parameter. None of these three parameters is required.
Here is to say, the use of parameter 1: such as the following language
int nLine = 0, nList = 0;
1. for (nLine = 0; nLine < nline++)
{
......;
}
2. for (; nLine <; nline++)
{
......;
}
Here the parameter 1 is already initialized outside the for loop, does it need to be initialized in the for loop? This depends on whether you use this parameter or not elsewhere, and if nline is still used in 2, then the 2nd for Loop will have to be initialized with parameter 1, or the value of nline after the 1th for loop is not 0.
about problems encountered during the use of the For () loop (problems encountered in Tetris games)