pw********@yahoo.co.in wrote:
give me the values saperately(2 values of a)
It could be anything 17,18 or 19.
a+= a++ + ++a;
Its not guaranteed that which of subexpression a++ or
++a would be evaluated first. Suppose, that some implementation
does a++ first and then ++a. Taking initial value of a=5,
a++ would take a initial value 5 before incrementing. Now,
since there is no sequence point after a++, its not guaranteed
if the location where "a" is stored has the updated value or not.
So,while evaluating ++a, "a" could be either 5 or it could be 6. Also,
when ++a is evaluated, again there's
is no guarantee if location "a" has been updated with the
incremented value. So, when you add (a++ + ++a) to a, you
are not sure what would be the value of a. It could be 5,6 or
even 7.
The only sequence point in this statement is "semicolon" after
which all the side effects due to this statement would have
been settled.