Secondly, you should realize the significance of the three parts of this structure. 1 int i=0 defines an integer variable I and gives it an initial value of 0; The second is the loop execution condition. If this condition is true, then this sentence will be repeated until the value is false, and i++ is the loop body. I++ can also be written as i=i+ 1. Means I increase1; I can also see that you are writing an infinite loop, because I will increase infinitely and have no end. As for when you say i=2, you can actually see how many times this loop has been executed. In fact, every execution process is to assign a value to I, and I =1is executed for the first time; On the second execution, I++ is executed. At this time, i=2, so what does i=0 mean? . That is, when this loop body is not executed, I is not self-increasing at this time. .
So there is no right or wrong. . . It's just that the value changes every time it's executed.