1 次元として定義されているのに、2 つのパラメーターを持つポインターの配列にアクセスできるのはなぜですか?
関数で多次元配列にアクセスするには、ポインターの配列を操作する必要があることはわかっていますが、2 つのパラメーターを使用してポインターの配列にアクセスできる理由がわかりません。
int a[m][l] { 1,2,3,4, 2,3,4,5, 3,4,5,6 }; //some matrices
int c[m][l];
int *ap[m]; //array of pointers one-dimensional
int i,j;
for (i = 0; i < m; i++) //passing the address of first element in each
ap[i] = a[i]; //colon of matrix to array of pointers
for (j = 0; j < m; j++)
bp[i] = b[i];
dosomethingwithmatrix(ap[0], bp[0], m, l);
int* dosomethingwithmatrix(const int*ap[], int* bp[])
{
cp[i][j] = ap[i][j] //accss the array of pointers with two parameters
}