Dynamic multidimensional arrays

Jeff Rodriguez jjr at ut-emx.UUCP
Thu Jun 16 13:23:03 AEST 1988


In article <4556 at haddock.ISC.COM> karl at haddock.ima.isc.com (Karl Heuer) writes:
>If you allocate the entire array (including space for the pointers as well as
>the contents) in a single chunk, then you don't need all those free_array()
>routines -- the standard free() will work.  I've written it this way.

Quite true.  Another benefit is that the one can use one call to fread()
to read a binary image from a file directly into one of these arrays.
If each row is allocated with a separate call to malloc(), then the
resulting array must be filled one row at a time.

			Jeff Rodriguez
			jjr at emx.utexas.edu



More information about the Comp.lang.c mailing list