"array" vs. "&array" ?

Michael Hunter bagpiper at pnet02.gryphon.com
Wed Jan 10 15:20:22 AEST 1990


chuckp at ncr-fc.FtCollins.NCR.com (Chuck Phillips) writes:
>In article <2378 at ektools.UUCP> randolph at 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, <routing site>}!gryphon!pnet02!bagpiper
INET: bagpiper at pnet02.gryphon.com



More information about the Comp.lang.c mailing list