pointers to arrays and the '&' oper

vijay at bradley.UUCP vijay at bradley.UUCP
Wed Mar 8 00:50:00 AEST 1989


/* Written 11:19 am  Feb 16, 1989 by gwyn at smoke.BRL.MIL in bradley:comp.lang.c */
In article <3927 at ingr.com> crossgl at ingr.com (Gordon Cross) writes:
>Allright, the recent discussion regarding pointers to arrays in C reminds
>me of something that I consider to be a major deficiency of the language.

It is actually the fact that arrays are not first-class objects in C
that is the deficiency.  This cannot be fully remedied without
invalidating large amounts of existing correct code.

>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??

In ANSI C, you are allowed to do so.

Many existing (PCC-based) compilers permit &array but ignore the &.
That is not the ANSI C behavior, though.  For maximal portability
you should avoid using &array for a few years.
/* End of text from bradley:comp.lang.c */



More information about the Comp.lang.c mailing list