有谁知道如何在 C 中填充二维(动态)数组?我有这个:
double** A;
A = ( double** )malloc( 2*sizeof( double* ));
for (int i = 0; i < 2; i++ ) A[i] = ( double* )malloc( 3 );
A[0][0] = 1;
A[0][1] = 2;
A[0][2] = 3;
A[1][0] = 4;
A[1][1] = 5;
A[1][2] = 6;
printf("%d", A[1][1]);
但它只打印零……:/
有人帮忙吗?谢谢 :)