Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rlgvax!hadron!jsdy From: jsdy@hadron.UUCP (Joseph S. D. Yao) Newsgroups: net.lang.c Subject: Re: Address of array Message-ID: <339@hadron.UUCP> Date: Thu, 27-Mar-86 01:02:19 EST Article-I.D.: hadron.339 Posted: Thu Mar 27 01:02:19 1986 Date-Received: Sat, 29-Mar-86 05:57:49 EST References: <750@abic.UUCP> <2293@utcsri.UUCP> <313@hadron.UUCP> <2377@utcsri.UUCP> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Organization: Hadron, Inc., Fairfax, VA Lines: 35 Summary: Right, up to a point ... In article <2377@utcsri.UUCP> greg@utcsri.UUCP (Gregory Smith) writes: a very clear exposition of where I went wrong when I said: >> There is no such thing as a pointer to the whole >>array: that is a Pasqualische or Fortranian notion. Pointers, in >>C, only point to atomic or aggregate (structure/union) objects. up to the point where he slips off the track: > Anyway, array names >are not always constants; any array which is local to a function has an address >which is relative to the frame pointer. Also, in > struct foo{ int foodle; char foo_line[80]; } *foo_ptr; >the ARRAY foo_ptr->foo_line doesn't have a constant address, does it? Well ... this is true, but only the sense that a n y address is relative to the address space in which it lives. Something is not a constant if it can be changed, right? But you cannot say: foo_ptr->foo_line++ or { int x[XSIZ]; x++; } Despite the fact that I stupidly said there ain't no array pointers (and I should know better, I've found where I'd written otherwise!), I still insist that, the way C treats them right now, the model for arrays is a pointer constant. In stack and struct, this translates to a pointer constant o f f s e t . -- Joe Yao hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}