请教: 这样定义一个三维数组对不?
double* dmatrix1(int N){
double *u;
u = (double *) malloc(sizeof(double) * N);
return u;
}
double** dmatrix2(int M,int N)
{
int i;
double **u;
u = (double **) malloc(sizeof(double *) * M);
for(i=0;i<M;i++) u[i] = dmatrix1(N);
return u;
}
double*** dmatrix3(int Q,int M,int N)
{ int i;
double ***u;
u = (double ***) malloc(sizeof(double **) * Q);
for(i=0;i<Q;i++)
u[i]= dmatrix2(M,N);
return u;
}