Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!gvlf3.gvl.unisys.com!burdvax!ubbpc!wgh From: wgh@ubbpc.UUCP (William G. Hutchison) Newsgroups: comp.lang.c Subject: Re: 10[25]==35? Really? Summary: Did this example really compile? Message-ID: <784@ubbpc.UUCP> Date: 26 Feb 91 16:21:45 GMT References: <25694@netcom.COM> Organization: Unisys UNIX Portation Center, Blue Bell, PA Lines: 28 In article <25694@netcom.COM>, avery@netcom.COM (Avery Colter) writes: > With all this about the #define X1 -10, I find it interesting that > indexing a constant yields the sum of the constant and the number inside > the brackets. > > I could RTFM till the cows come home and never would have gleaned this. > > Silly me, I would have thought that 10[25] would yield the value > residing in the position 25 positions away from address 10. > # cat ca.c main() { printf("%d\n", 10[25]); return 0; } # make ca cc -O ca.c -o ca "ca.c", line 2: illegal indirection *** Error code 1 Stop. I don't see how RTFMing can show you something that is not true??? -- Bill Hutchison, DP Consultant psuvax1!burdvax!ubbpc!wgh (work) Unisys UNIX Portation Center uunet!eidolon!wgh (home) P.O. Box 500, M.S. B121 "At the moment I feel more like arguing than Blue Bell, PA 19424 being good" Raymond Smullyan _The Tao is Silent_