From: Jason Alexander Newsgroups: comp.os.msdos.djgpp Subject: Dynamically declaring 2-d arrays Date: Mon, 09 Feb 1998 15:54:44 -0800 Organization: University of California, Irvine Lines: 18 Message-ID: <34DF9744.C7CFDBFE@ea.oac.uci.edu> NNTP-Posting-Host: pv1821.pv.reshsg.uci.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Can someone explain to me how to dynamically declare a 2-d array? I know the following code works for dynamically declaring a 1-d array of integers, but I don't see how to extend it to the 2-d case. int main(void) { int i; int *array; printf("Array dimension: "); scanf("%d", &i); array = (int *) malloc(i*sizeof(int)) } Thanks, Jason