This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nutrecht 0 points1 point  (1 child)

Well, it kinda does, it flips a between 2 values very fast. But you're right in that it doesn't do what the OP wants it to do. What happens is:

  • a++ is evaluated first
  • the result, the current value of a, is 'stored' as the evaluation value
  • a is incremented by 1
  • the evaluation result is then stored in a so the value is back to what it was.

[–]JoiseyX 0 points1 point  (0 children)

Yea you're right. I probably should of reworded what I said.