Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!portal!cup.portal.com!Tim_CDC_Roberts From: Tim_CDC_Roberts@cup.portal.com Newsgroups: comp.lang.c Subject: Re: Another silly question Message-ID: <17812@cup.portal.com> Date: 1 May 89 15:55:44 GMT References: <2459@nmtsun.nmt.edu> <9987@claris.com> <879@twwells.uucp> Organization: The Portal System (TM) Lines: 19 Ok, folks. In regards to "a[i] == *(a+i) == *(i+a) == i[a]", let me refer to the oft-used example 2["hello"]. I agree that this works and is equivalent to "hello"[2]. I've seen it in books and postings. My simple question is why? (Please don't submit 30 replies saying "because the book says so"...) Doesn't that equivalence imply that the pointer type is somehow "stronger" than the simple type? Is that, in fact, the case? Is a compiler force to examine all of the elements in a pointer expression and establish the "master type" of the expression? If I mix two pointer types, as in char * c; long * ell; return c + ell; is this anarchy? Is it a syntax error? What is sizeof(*(c+ell))? Inquiring minds want to know. Tim_CDC_Roberts@cup.portal.com | Control Data... ...!sun!portal!cup.portal.com!tim_cdc_roberts | ...or it will control you.