#include<iostream>
using namespace std;
class Base {
public:
    int m_A;
    void func(){
        cout<<"Base func()调用"<<endl; 
    } 
protected:
    int m_B;
private:
    int m_C;
};
class Son :public Base {
public:
    int m_D;
    void func(){
        cout<<"Son func()调用"<<endl; 
    } 
};
int main() {
    //父类中所有非静态成员属性都会被子类继承 
    //父类中私有成员属性被编译器隐藏,因此访问不到
    //开发人员命令提示工具->进入程序所在文件夹
    //->输入cl /d1 reportSingleClassLayout类名 "文件名"
    cout << "size of Son: " << sizeof(Son) << endl;
    //父类和子类中func()成员函数都注释掉,输出16
    //父类中func()成员函数注释掉,输出16
    //子类中func()成员函数注释掉,输出16
    //父类和子类中func()成员函数都不注释,输出16
    system("pause");
    return 0;
}