Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!rpi!image.soe.clarkson.edu!sunybcs!boulder!ccncsu!ncr-fc!chuckp From: chuckp@ncr-fc.FtCollins.NCR.com (Chuck Phillips) Newsgroups: comp.lang.c Subject: Re: "array" vs. "&array" ? Message-ID: Date: 9 Jan 90 20:27:35 GMT References: <1989Dec22.013757.3086@sj.ate.slb.com> <571@mwtech.UUCP> <2368@ektools.UUCP> <21621@mimsy.umd.edu> <2378@ektools.UUCP> Sender: news@ncr-fc.FtCollins.NCR.COM Organization: NCR Microelectronics, Ft. Collins, CO Lines: 26 In-reply-to: randolph@ektools.UUCP's message of 9 Jan 90 15:39:53 GMT 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 doesn't make sense to me, nor does it make sense to several of the compilers I've used. Some have printed a message to the effect, "Surely you must be joking. I'll ignore the '&' and pretend you just wrote 'arrf', you naughty, naughty little programmer." My question: Is this now part of ANSI C? (Yuk!) -- Chuck Phillips -- chuckp%bach.ncr-fc.FtCollins.NCR.COM