Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.lang.c Subject: Re: Another silly question Message-ID: <1648@auspex.auspex.com> Date: 18 May 89 16:53:32 GMT References: <17812@cup.portal.com> <2336@Portia.Stanford.EDU> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 26 > When "+" denotes simple (ie int/float/etc) arithmetic, the > operation commutes; when it denotes pointer arithmetic, > commutation is not legal/meaningful. Funny, X3J11 disagrees with you: 3.3.6 Additive operators ... Semantics ... ...In other words, if the expression "P" pointers to the "i"th element of an array object, the expressions "(P)+N" (equivalently, "N+(P)")... > The statement that *(a+i) == *(i+a) is therefore invalid. The statement that "The statement that *(a+i) == *(i+a) is therefore invalid" is therefore invalid. It may make life miserable for compiler writers, but if so they should have lobbied X3J11; it's probably too late now - go forth and fix your compiler, if it can't cope with "i[a]".