C++ 没有列号的二维数组给出地址? intarr[][3]={{1,3},{2,3},{6,7}; cout

C++ 没有列号的二维数组给出地址? intarr[][3]={{1,3},{2,3},{6,7}; cout,c++,arrays,C++,Arrays,由于arr是一个二维数组,arr[0]将为您提供整行(更准确地说,是该行的地址) 更准确地说,因为arr是int[][3]arr[0]是int[3]类型,它衰减为int*。因此,coutarray[0]保存array[0][0…n-1]值的地址,因此只有cout int arr[][3] = {{1,3},{2,3},{6,7}}; cout << arr[0] << endl; // W/O col' somehow give you the address, no

由于
arr
是一个二维数组,
arr[0]
将为您提供整行(更准确地说,是该行的地址)


更准确地说,因为
arr
int[][3]
arr[0]
int[3]
类型,它衰减为
int*
。因此,
cout
array[0]
保存
array[0][0…n-1]
值的地址,因此只有
cout
int arr[][3] = {{1,3},{2,3},{6,7}};
cout << arr[0] << endl;   // W/O col' somehow give you the address, not the element.
cout << arr[0][0] << endl;
array[0][0] ... array[0][n-1]