Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
i++ - postfix increment. Since there are no bells and whistles with a sequence point from C++ and C, it will definitely work here:
i+=i++ can be rewritten as
result=i+i++
without any problems
;
+0
i=1
we count the addition 0 + 0 (the value that was in i before the expression was evaluated, and what we pulled out during the prefix increment)
result=0
i=1
now we write the result of adding 0 to 0 into i, overwriting earlier 1 written there.
i=result //here i will be written 0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question