Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!boulder!ccncsu!ncr-fc!chuckp From: chuckp@ncr-fc.FtCollins.NCR.com (Chuck Phillips) Newsgroups: comp.lang.c Subject: Re: "array" vs. "&array" ? (not again! :-O ) Message-ID: Date: 10 Jan 90 17:32:28 GMT References: <24521@gryphon.COM> Sender: news@ncr-fc.FtCollins.NCR.COM Organization: NCR Microelectronics, Ft. Collins, CO Lines: 42 In-reply-to: bagpiper@pnet02.gryphon.com's message of 10 Jan 90 04:20:22 GMT ]In article <24521@gryphon.COM> bagpiper@pnet02.gryphon.com (Michael Hunter) writes: ]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.) Granted. But the question remains: "What is the compiler supposed to do when the programmer askes for a pointer to something in the symbol table?" Personally I like the idea of hysterical electronic laughter, but was asking what ANSI had specified. Before someone else does, let me flame myself: #pragma FLAME_ON Please add to the list of the most commonly deserved answers to the most commonly asked C questions instructions for obtaining the ANSI C standard. (i.e. how to get TFM) #pragma FLAME_ON Question: Wouldn't it be _really neat_ if the actual ANSI C standard were commonly available in CS related bookstores? #include -- Chuck Phillips -- chuckp%bach.ncr-fc.FtCollins.NCR.COM