them?/How did you overcome them?
Today, for Worksheet A3.2, I could not understand problem 14. I dont understand why:
b=2;
a=b++;
The result of that is
a=2
b=3
It seems that they should be the same, but they aren't. Why is that? I plan to overcome this problem by asking you.
1 comment:
This is that special case. If the increment operator is on the right, then the assignment happens before the things is incremented. If it's the opposite:
a=++b
then they would both end up being equal.
Post a Comment