posted 22 years ago
It gets incremented, but you are overwriting its value afterwards.
You are assigning i the value of an expression. To do this, the expression *first* gets evaluated.
So, i gets incremented - the value of i++ is the value of i before the increment.
Now that the expression has been evaluated, we can assign the result of the evaluation to i. So we are assigning the value of i before the increment to i.
It looks like the incrementation never happend, but it has.
Does that help?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus