#include <iostream>
using namespace std;
class A {
};
class B {
void fun()
{
}
};
int main()
{
int three[2][2][3] = { {{1,2,3},{4,5,6}},{{7,8,9},{10,11,12}} };
//三维数组单变量访问,先除再取余。
for (int i = 0;i < 12;++i)
{
cout << three[i / 6][i % 6 / 3][i % 6 % 3] << " ";
}
cout << endl;
cout << "空类\t" << sizeof(A) << endl //1
<< "类仅含一个有函数体的函数\t" << sizeof(B) << endl; //函数有无函数体都为1
//若为虚函数,为4,仅需一个指针指向虚函数表
cout<< "\t\t\t\t\t\t@zem" << endl;
system("pause");
return 0;
}
三维数组使用单变量访问,类的大小
最新推荐文章于 2017-10-12 12:03:40 发布