Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!gryphon!pnet02!bagpiper From: bagpiper@pnet02.gryphon.com (Michael Hunter) Newsgroups: comp.lang.c Subject: Re: "array" vs. "&array" ? Message-ID: <24521@gryphon.COM> Date: 10 Jan 90 04:20:22 GMT Sender: root@gryphon.COM Organization: People-Net [pnet02], Redondo Beach, CA. Lines: 28 chuckp@ncr-fc.FtCollins.NCR.com (Chuck Phillips) writes: >In article <2378@ektools.UUCP> randolph@ektools.UUCP (Gary L. Randolph) writes: >> Am I wrong in the inference from K&R that: > >> float arrf[3] = {1.2,2.3,3.4}; >> arrf; /*evaluates to pointer to float according to K&R*/ > >When declaring/defining arrf, space is allocated for a pointer to the array >_in the symbol table_, _not_ in the actual object code. (i.e. this address >may not manifest itself in the object code at all if never referenced) > >> &arrf; /*evaluates to pointer to pointer to float (my inference)*/ > >So now, as I understand it, you're asking for a pointer to something that >exists in the symbol table that is often stripped from the final version of >programs. > This must be done by the linker or some postprocessor of the executable...otherwise how could the compiler tell that a object is not referenced in some other module (even static functions or varaibles via pointers.) Michael Mike Hunter - Box's and CPU's from HELL: iapx80[012]86, PR1ME 50 Series, 1750a UUCP: {ames!elroy, }!gryphon!pnet02!bagpiper INET: bagpiper@pnet02.gryphon.com