op= operators

Robert the Good rhl at astrovax.UUCP
Wed Oct 3 08:22:51 AEST 1984


I am not sure how K&R specify that
	*ptr++ += 2;
should be evaluated. Page 191 says only that the behaviour of E1 op= E2
is the same as E1 = E1 op E2, but does that mean in this case
	*ptr++ += *ptr++ + 2;
	*ptr += *ptr++ + 2;
or
	*ptr++ += *ptr + 2; ? (and what does the first form mean?)

For out 4.2 bsd compiler, the last form is used, with the incrementation of
the pointer after the addition of 2. Is this guaranteed by the standard?
			Robert



More information about the Comp.lang.c mailing list