多次元配列のallocate
double **mat; int i, int n=5; mat = (double **)calloc(n, sizeof(double)); for (i=0; i<n; i++) { mat[i] = (double *)calloc(n, sizeof(double)); } ... if (mat[0]) free(mat[0]); if (mat) free(mat); ...
double **mat; int i, int n=5; mat = (double **)calloc(n, sizeof(double)); for (i=0; i<n; i++) { mat[i] = (double *)calloc(n, sizeof(double)); } ... if (mat[0]) free(mat[0]); if (mat) free(mat); ...