Date: Thu, 9 Aug 2001 16:29:04 -0300 (ART) From: Fernando Gleiser <fgleiser@cactus.fi.uba.ar> To: "Hays, Sam" <SGHays@PatioEnclosuresInc.com> Cc: "'freebsd-questions@freebsd.org'" <freebsd-questions@FreeBSD.ORG> Subject: Re: Goofy programming question ( C ) Message-ID: <20010809160227.I71785-100000@cactus.fi.uba.ar> In-Reply-To: <F3E75182E249D3119CF1006008A950CEB6BE2E@mozart.patioenclosuresinc.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 9 Aug 2001, Hays, Sam wrote: > > the question: > Passing a two dimensional array to a function via a pointer. > > what I have is this: > void function(char* array); > . . . > char array[4][4]; > function(array); > . . . function expects an char * as an argument. array is not a char *. change the prototype to void function (char array[][4]). > > that doesn't work. I've tried a whole slew of other things, anybody have > any suggestions? Yes, read chapter 5 of K&R ("pointers and arrays"). Look for the section about multidimensional arrays. Fer > > -SH > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010809160227.I71785-100000>