Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!agate!shelby!neon!Gang-of-Four!dkeisen From: dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) Newsgroups: comp.lang.c Subject: Re: Passing Multi-dimensional arrays to a function Message-ID: <1990Jul20.142408.352@Neon.Stanford.EDU> Date: 20 Jul 90 14:24:08 GMT References: <1990Jul17.224910.20086@DRD.Com> <9905@crdgw1.crd.ge.com> <1990Jul19.112403.709@DRD.Com> Sender: news@Neon.Stanford.EDU (USENET News System) Distribution: na Organization: Sequoia Peripherals Lines: 26 In article <1990Jul19.112403.709@DRD.Com> tdh@drd.Com (Tom Haynes) writes: >volpe@underdog.crd.ge.com (Christopher R Volpe) wrote: >} > cischa(pnlptr, "PREFIX", 0, SCREEN, prefix[curr]); >} * ^^^^^^^^^^^^ >} * prefix[curr] is of type (char *) whereas the formal parameter >} * is of type (char **). Maybe you wanted "&prefix[curr]"??? >} * > >I tried that, along with &prefix[curr][0], both were no go. >Error message was something like '& not allowed on struct/array'. > Many compilers don't take &prefix[curr] when prefix[curr] is an array, you can use prefix + curr instead. But prefix + curr is still of type pointer to array of char, the formal paramter is of type pointer to pointer of char; the types still don't match. -- Dave Eisen Home: (415) 323-9757 dkeisen@Gang-of-Four.Stanford.EDU Office: (415) 967-5644 1447 N. Shoreline Blvd. Mountain View, CA 94043