Dynamic allocation of multi-d arrays

James H. Cloos Jr. cloos at batcomputer.tn.cornell.edu
Thu Jun 22 16:27:18 AEST 1989


Hello,

Is it possible to dynamically allocate a multi-dimentional array using the
standard Unix libraries?  How is this done?

I believe I understand how to do single-d arrays, but haven't seen anything
suggesting how to do multi-d.  Or at least 2-D.

Do you have to set up a single-d array and use a pointer to specify the
beginning of the current 'row?'

I hope this isn't too much of a novice-mode question, but an application
I'm starting to work on is the first I've done that needs dynamic multi-d
arrays--unless I can come up with a better algorithm. ;^)

Thank you for any info!

-JimC
--
James H. Cloos, Jr.          "Entropy isn't what it used to be."
jhc at Crnlvax5.BITNET            --c/o Fortune @ batcomputer.UUCP
jhc at Vax5.CCS.Cornell.ED		 #include <std_disclaimers.h>
cornell!vax1!vax5.cit.cornell.edu!jhc at rochester.UUCP
B-7 Upson Hall, Cornell Univ., Ithaca, NY 14853   +1 607 272 4519
Urgent mail to: cloos at TcGould.TN.Cornell.EDU cloos at CrnlThry.BITNET
	    or: batcomputer!cloos at cornell.UUCP



More information about the Comp.lang.c mailing list