Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!bucsb!castong From: castong@bucsb.UUCP (Paul Castonguay) Newsgroups: comp.lang.c Subject: Re: Another silly question Message-ID: <2555@bucsb.UUCP> Date: 24 May 89 01:15:20 GMT References: <17812@cup.portal.com> <2336@Portia.Stanford.EDU> <9372@alice.UUCP> Reply-To: castong@bucsb.bu.edu (paul castonguay) Followup-To: comp.lang.c Organization: Boston Univ Comp. Sci. Lines: 29 > >> The statement that *(a+i) == *(i+a) is therefore invalid. > >No, the statment is true. >-- #include main() { int *a; int i=1; a = (int *)malloc(16); *a = 0; *(a+1) = 4; *(a+2) = 0; *(a+3) = 0; printf("*(a+i) = %d ", *(a+i)); printf("*(i+a) = %d\n", *(i+a)); } Output produced: *(a+i) = 4 *(i+a) = 4 Does that not show that *(a+i) == *(i+a) ?