Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!seismo!mcvax!philmds!prle!nvpna1!strouckn From: strouckn@nvpna1.UUCP (Louis Stroucken 42720) Newsgroups: comp.lang.c Subject: Re: char (*a)[] (was: Style [++i vs i++]) Message-ID: <234@nvpna1.UUCP> Date: Wed, 12-Aug-87 05:52:46 EDT Article-I.D.: nvpna1.234 Posted: Wed Aug 12 05:52:46 1987 Date-Received: Fri, 14-Aug-87 02:00:20 EDT References: <8298@brl-adm.ARPA> <587@cblpe.ATT.COM> <189@xyzzy.UUCP> <1987Aug10.192923.7879@sq.uucp> Reply-To: strouckn@nvpna1.UUCP (Louis Stroucken 42720) Organization: Philips Research Labs, Eindhoven, Netherlands Lines: 29 Summary: a is a formal argument, so char (*a)[] => char **a In article <1987Aug10.192923.7879@sq.uucp> msb@sq.UUCP (Mark Brader) writes: > >Regarding the code... > >> > main(a) >> > char (*a)[]; [ discussion wether "a++;" should do something sensible ] > >Actually, *declaring* such a pointer is probably illegal. The language >in K&R appendix A section 8.4 is a bit fuzzy, but seems to imply this; >and section 3.5.3.2 of the (Oct.'86) ANSI draft nails it down clearly. I haven't got any ANSI draft here, so I'd better stay out of the discussion, but: Please note that "a" is a formal argument of main!! K&R appendix A section 10.4 says on array arguments: ...formal parameters declared "array of..." are adjusted to read "pointer to...". The declaration of "a" might as well read "char **a;". "a++;" should increment "a" with sizeof( char * ) bytes. If I miss something, please let me know. Louis Stroucken UUCP: ...!mcvax!philmds!prle1!nvpna1!strouckn