Dynamic memory allocation of 2d arraysThis tip submitted by nandam on 2006-08-29 06:26:56. It has been viewed 6417 times.
Rating of 3.0 with 4 votes
To dynamicallly alloc an array of size mXn with fewer memory allocations than n + 1:
double **M; M= (double**)malloc(m*sizeof(double*)); M =(double*)malloc(m*n*sizeof(double)); for(i=1;i