pointers to arrays and the '&' operator

Guy Harris guy at auspex.UUCP
Sat Feb 18 05:07:14 AEST 1989


>Since I am allowed to declare something that has type "pointer to an array
>of...", then why am I not permitted to apply the '&' (address of) operator
>directly to an array?? ... Do more recent versions of the standard
>address (no pun intended) this concern??

All the versions of the dpANS that I've seen allow you to apply "&" to
an array; I would be extremely surprised if the latest version of the
pANS didn't permit you to do so as well.  The reason why you're not
generally permitted to do this on, say, UNIX systems is that many C
compilers on UNIX systems don't implement that part of the language in
the dpANS (e.g. the Ritchie compiler, or PCC).

>P.S.  The same argument can be said for pointers to functions and &E where
>      E is the name of a function...

The May 19, 1988 dpANS indicates that "function designators" don't get
turned into "pointer to function" expressions when used as the operand
of "sizeof" or unary "&", so that version (and presumably later
versions) of the (draft) proposed standard allows you to do &E as well. 



More information about the Comp.lang.c mailing list