3 回答
TA贡献1772条经验 获得超8个赞
2d数组是双指针吗?
int **ptr = (int**)matrix;
matrix: 11 22 33 99 44 55 66 110 ----------- the first element of matrix ------------ the second element of matrix
matrix[x][y]
the base address of matrix + x*4 + y
int (*)[4]
4
matrix_ptr[x][y]
matrix_ptr + x*4 + y
ptr=(int**)matrix
*ptr
matrix[1]
sizeof(int)==1
TA贡献1824条经验 获得超5个赞
int arr[5][3][2];
int
arr[0][0][0]
arr[1][0][0]
arr[0][1][0]
arr
arr[0]
sizeof
sizeof
int *arr[3];int aa[2] = { 10, 11 }, ab[2] = { 12, 13 }, ac[2] = { 14, 15 };arr[0] = aa;arr[1] = ab;arr[2] = ac;
arr[1][0]
12
int
1 * 2 * sizeof(int)
arr
int
0 * sizeof(int)
arr[1]
sizeof(arr[0])
sizeof(int *)
sizeof(int) * 2
.
TA贡献1793条经验 获得超6个赞
[2][4];
matrix
matrix
- 3 回答
- 0 关注
- 442 浏览
添加回答
举报