#include <iostream>

using namespace std;

int main() {

    int arry[][] = {
{,,},
{,,} }; cout << "二维数组大小 = "<< sizeof(arry) << endl;
cout << "二维数组一行大小 = " << sizeof(arry[]) << endl;
cout << "二维数组元素大小 = " << sizeof(arry[][]) << endl; cout << "二维数组行数 = " << sizeof(arry) / sizeof(arry[]) << endl;
cout << "二维数组列数 = " << sizeof(arry[]) / sizeof(arry[][]) << endl;
//cout << "hello world!" << endl; //地址
cout << "二维数组首地址 = " << arry << endl;
cout << "二维数组第一行地址 = " << arry[] << endl;
cout << "二维数组第二行地址 = " << arry[] << endl; cout << "二维数组第一个元素地址 = " << &arry[][] << endl;
cout << "二维数组第二个元素地址 = " << &arry[][] << endl;
system("pause");
return ;
} //===================================

#include <iostream>

using namespace std;

int main(){

int a = 0;

int arry[3][3] = {
{1,2,3},
{55,66,77},
{21,34,11}
};
cout << "输出地址 = " << &arry << endl;
cout << "二维数组第一行 = " << arry[0] << endl;
cout << "二位数组行数 =" << sizeof(arry) / sizeof(arry[0]) << endl;
cout << "二位数组列数 =" << sizeof(arry[0]) / sizeof(arry[0][0]) << endl;
cout << "二位数组占内存大小 =" << sizeof(arry) << endl;
cout << "二位数组一行占内存大小 =" << sizeof(arry[0]) << endl;
cout << "二位数组总共占内存大小 =" << sizeof(arry[0][0]) << endl;

return 0;

}


05-08 15:30