Date: Mon, 21 Jun 1999 12:41:19 +0200 From: Hans-Bernhard Broeker Message-Id: <199906211041.MAA09469@acp3bf.physik.rwth-aachen.de> To: djgpp AT delorie DOT com Subject: Re: Dinamic allocation Newsgroups: comp.os.msdos.djgpp Organization: RWTH Aachen, III. physikalisches Institut B X-Newsreader: TIN [version 1.2 PL2] Reply-To: djgpp AT delorie DOT com In article you wrote: > I'm still look for a way to allocate arrays with 2 > or more indexes. The basic trick is that there is no such thing as a multi-dimensional array in C. There are only one-dimensional arrays, but you can have an array of arrays, as a replacement of multidimensional arrays. Now, if you want the array to be dynamic (i.e. you can choose the size of all the dimensions at run-time of the program), you're not really talking about arrays, any more. It's *pointers*, now. Pointers can also be accessed using the traditional array notation a[i]. Pointers to pointers can thus be accessed by a[i][j], too. That's what the first poster suggested, effectively: char **store = malloc(height * sizeof(char *)); for (i=0; i