Another silly question

Andrew Koenig ark at alice.UUCP
Thu May 18 23:45:47 AEST 1989


In article <2336 at Portia.Stanford.EDU>, mesmo at Portia.Stanford.EDU (Chris Johnson) writes:

> 	When "+" denotes simple (ie int/float/etc) arithmetic, the
> 	operation commutes; when it denotes pointer arithmetic,
> 	commutation is not legal/meaningful.

Yes it is.  Addition of integers and pointers is commutative.

> 	The statement that *(a+i) == *(i+a) is therefore invalid.

No, the statment is true.
-- 
				--Andrew Koenig
				  ark at europa.att.com



More information about the Comp.lang.c mailing list