"[][]" revisited

Mark Nagel nagel at ics.uci.edu
Fri Mar 23 11:57:43 AEST 1990


rfg at paris.ics.uci.edu (Ronald Guilmette) writes:

>Lots of people have sent me messages containing their opinions regarding
>the legality or illegality of declarations like:

>int (*foo)[][];

>But none of these folks has yet produced the smoking gun, i.e. nobody
>has cited any passage from the ANSI standard that *either* says that
>this is illegal or that it is illegal.

While not _the_ ANSI standard, take a look at K&R II, pp. 216-217.
An array declaration without a size specification is an incomplete
type.  An array may only be constructed from a complete type.  If
you think about how arrays are layed out in memory, you'll
understand why this must be true.
--
Mark Nagel
UC Irvine Department of ICS   +----------------------------------------+
ARPA: nagel at ics.uci.edu       | Six plus six equals fourteen for large |
UUCP: ucbvax!ucivax!nagel     | values of six -- Dave Ackerman         |



More information about the Comp.std.c mailing list