M. Naskovski
-- #include <stdio.h> #include <stdlib.h>double **dim2d(int n, int m) /* n = # of rows, m = # of columns */ { int i; double **narr; narr=(double **)calloc(n, sizeof(double *)); if (narr == NULL) return NULL; for (i=0; i < n; i++) { narr[i]=(double *)calloc(m, sizeof(double)); if (narr[i] == NULL) return NULL; } return narr; }
main() { double **a=dim2d(1,1); double a2[1][1]; a[0][0]=255; a[0][5]=256;
a2[0][0]=255; a2[0][5]=256; }