Isn't it checked it doesn't equal 0 everytime the loop is executed to check if it is still true?
How do you reach this conclusion?
Evaluate the statements logically. x=0 is assigning x to 0. Then x is evaluated. Since x is 0, it's the same as evaluating 0. 0 translates to false. You may as well have written the following: for(x = 10; false; x = x -1) . This loop will never iterate. The condition is always false. How do you compare x to 0? There's a few different operators, like <, and >. What's the operator for "not equal to"?
EDIT: Or rather, since this is C, there's no boolean type, but 0 is treated as false.
This post has been edited by Oler1s: 13 September 2010 - 11:04 AM