当前演示在vstudio中
class Base
{
public:
int a;
protected:
int b;
private:
int c;
};
class Son :public Base
{
public:
int d;
int e;
};
int main(int argc, char* argv[])
{
cout << sizeof(Son) << endl;
return 0;
}
步骤:
cl /d1 reportSingleClassLayoutSon test.cpp
Son类的布局: