Quote Originally Posted by Ioannis View Post
Hmm, what is the difference between your 2nd and 3rd example?
Oops! The second example post-increments the variable and isn't valid. Sorry!

Finally is result the same for all cases?
Yes, except for the second example which isn't valid.

My sense is that a good compiler should deal with all these more effectively.
That seems to be the difficult part for just about every compiler.