Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site hou4b.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxj!houxm!vax135!ariel!hou4b!mat From: mat@hou4b.UUCP (Mark Terribile) Newsgroups: net.lang.c Subject: Re: Array parameters Message-ID: <1265@hou4b.UUCP> Date: Wed, 9-Jan-85 16:24:56 EST Article-I.D.: hou4b.1265 Posted: Wed Jan 9 16:24:56 1985 Date-Received: Fri, 11-Jan-85 22:51:20 EST References: <7081@brl-tgr.ARPA> Organization: AT&T Information Systems Laboratories, Holmdel, NJ Lines: 41 > Current C compilers allow passing a structure as a parameter. That's a > real structure, not a pointer to a struct as in the old style. > I presume then that one can pass a real array in the same fashion. Nope. Structures and arrays are fundamentally different sorts of aggregates with very different properties. > function (a); > int a[5][6] In this case, what you have is equivalent to int (*a)[ 6 ]; -- a pointer to an array of six ints. One of our local compilers accepts all of these without complaint: f( a ) int a[5][6]; { y( a ); } g( a ) int a[5][]; { y( a ); } h( a ) int a[][6]; { y( a ); } i( a ) int (*a)[6]; { y( a ); } -- from Mole End Mark Terribile (scrape .. dig ) hou4b!mat ,.. .,, ,,, ..,***_*.