- Joined
- Apr 1, 2005
- Messages
- 10,817
- Reaction score
- 6,536
I have a bit of code where I'm trying to increment values by one.
to achieve this I'd been using (variable++) but was not getting the expected outcome.
As an experiment, I changed it to (variable+=1) and now get the expected outcome.
I was under the impression that both expressions mean exactly the same thing.
Anyone seen this before or have an explanation for a coding newbie?
to achieve this I'd been using (variable++) but was not getting the expected outcome.
As an experiment, I changed it to (variable+=1) and now get the expected outcome.
I was under the impression that both expressions mean exactly the same thing.
Anyone seen this before or have an explanation for a coding newbie?