Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language. If I and j are both integer variables, the following cycle: for (i=0, j =-; j = 1; i++,j++)
C language. If I and j are both integer variables, the following cycle: for (i=0, j =-; j = 1; i++,j++)
When the for loop ends, look at the middle expression. The middle expression here is j =1; This is equivalent to the second expression every time, and j is 1, so the value of the intermediate expression is always true, so this loop has been executed countless times, which means that this loop is an infinite loop.

Note: Your expression 1 is wrong: j =-; This place