From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio Miranda Hamburger Subject: n-dimension dynamic allocated array with malloc() Date: Wed, 12 Jul 2006 15:58:59 -0600 (CST) Message-ID: Mime-Version: 1.0 Return-path: Sender: linux-c-programming-owner@vger.kernel.org List-Id: Content-Type: TEXT/PLAIN; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit To: linux-c-programming@vger.kernel.org Hello, What's wrong with the following code: [fabio@localhost projects]$ cat poc.c ; gcc poc.c ; ./a.out main() { #define A 100 #define B 100 #define C 100 #define D 100 int i,j,k,l; double ****array; //srand( (unsigned) time(0x0)); for(i=0;i< A; i++) { array = malloc(A * sizeof(double)); } for(i=0;i< B; i++) { array[i]=malloc(B * sizeof(double)); } for(i=0;i