This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Not quite; the assignment happens *last*. The increment occurs after the expression "i++" is evaluated. That expression ("i++") evaluates to the original value of i, and the result is "remembered". If the result of the expression "i++" is stored back into i, it's as if nothing happened at all. Here's another example:
The right-hand expression is evaluated as follows, starting with the first i++, the second i++, then adding the results of those two expressions, then assigning *that* value to i...
[ September 30, 2005: Message edited by: Steve Morrow ]