pointers to arrays

Steve Mawer scm at datlog.co.uk
Thu Feb 23 18:23:43 AEST 1989


In article <19784 at uflorida.cis.ufl.EDU> thoth at beach.cis.ufl.edu () writes:
>                 If E is an array (yes I know it's upper case but
>that's what he used) the &E should return a pointer to an array.  My
>question is "what will you use this for?"  Pointers are usually used
>to modify things, and &E I believe would be used to modify the address
>of the array since that's what E is (the address of the array).  YOU
>CAN'T DO THAT!!!

&E won't (shouldn't) modify the address since, as you say, it's already
cast in stone, so to speak.  What it *should* evaluate to is a pointer
to the address of the array.  This is clearly meaningless (and hence of
limited interest :-) since only the compiler should be interested in
where it keeps the value of E.

Most compilers that I've used will either flag an error, or will issue a
warning and *assume* that you meant &E[0] (or just E) and discard the &.

-- 
Steve C. Mawer        <scm at datlog.co.uk> or < {backbone}!ukc!datlog!scm >
                       Voice:  +44 1 863 0383 (x2153)



More information about the Comp.lang.c mailing list