#include #include int main(int argc, char **argv) { /* Declare a 1D array of pointers */ double *ptr[10]; int i,j; /* Malloc on each pointer so that it acts as the starting index to * another 1D array */ for(i = 0; i < 10; i++) { ptr[i] = (double *)malloc(sizeof(double)*10); } /* Initialize the array */ for(i = 0; i < 10; i++) for(j = 0; j < 10; j++) ptr[i][j] = i*j; /* Print the array */ for(i = 0; i < 10; i++) { for(j = 0; j < 10; j++) { printf("%lf\n",ptr[i][j]); } } }