*p++ = *p results?

Andrew Koenig ark at alice.UucP
Mon Mar 24 12:26:43 AEST 1986


> In the statement *p++ = *p; what will be the result?  Will p be equal
> to itself or will p be equal to the next value it is pointing to?
> In other words should p be incremented after it is evaluated or should
> p be incremented after the assignment operation is finished?-- 

This is undefined, because the implementation is permitted to evaluate
either side of the assignment first.



More information about the Comp.lang.c mailing list