This syntax is not standard syntax, and there is no guarantee that all compilers can compile this sentence, but if it can be compiled, i belongs to the block scope.
It should be a compiler problem. VS2010 may use the c90 standard. C90 does not allow direct declaration of int i=0 in for. Int i must be declared at the beginning of the program. C99 supports writing for like this. If it fails to compile, this may be the problem.
In the gcc compiler, the c language must first define a statement before it can be called. The mingw compiler can declare variables anywhere in the middle of the code
Non-standard syntax, compilers are different, and the results are not uniform. However, this question does not make sense. Modifying loop variables in the loop body is against programming standards
This syntax is not standard syntax, and there is no guarantee that all compilers can compile this sentence, but if it can be compiled, i belongs to the block scope.
It should be a compiler problem. VS2010 may use the c90 standard. C90 does not allow direct declaration of int i=0 in for. Int i must be declared at the beginning of the program. C99 supports writing for like this. If it fails to compile, this may be the problem.
In the gcc compiler, the c language must first define a statement before it can be called. The mingw compiler can declare variables anywhere in the middle of the code
Non-standard syntax, compilers are different, and the results are not uniform. However, this question does not make sense. Modifying loop variables in the loop body is against programming standards