Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!purdue!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Passing 2-D Arrays of unknown size ? Message-ID: <21415@mimsy.umd.edu> Date: 22 Dec 89 21:35:20 GMT References: <1387@engage.enet.dec.com> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 26 In article <1387@engage.enet.dec.com> wallace@oldtmr.dec.com (Ray Wallace) writes: >[the] solution_func3() is what I would use with a slight modification to >illiminate [sic] the calculation drawback you mention... > >solution_func3(array,rows,cols) >char *array; >int rows, cols; Note that this requires the caller---which has something like a char arr[ROWS][COLS]; ---to call func3() as func3(&arr[0][0], ROWS, COLS); and not as func3(arr, ROWS, COLS); since the latter has the wrong type (char (*)[COLS]). Remember, C does not have values, C has *typed* values. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris