Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.lang.c Subject: Re: pointers to arrays Message-ID: <1062@auspex.UUCP> Date: 24 Feb 89 18:28:40 GMT References: <19784@uflorida.cis.ufl.EDU> <13171@steinmetz.ge.com> <1044@auspex.UUCP> <7806@chinet.chi.il.us> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 25 >>> int flimflam[20]; ... >Does this imply that pointer math and subscripting of the returned >value is scaled by the size of the array? (i.e. would &flimflam + 1 >evaluate to the same address as flimflam + 20?) Yes. That's how it works now; if you have int (*flimflamp)[20]; then flimflamp + 1 would typically point "20*sizeof (int)" bytes past where "flimflamp" points, which is also where (*flimflamp) + 20 points ("*flimflamp" is an array-valued expression, and, in the (d)pANS *and*, at least, in PCC-based pre-(d)pANS C implementations and possibly other such implementations, is converted in that context to a pointer to the first member of that array).