#include<iostream>
using namespace std;
class c{
private:
int real,imag;
public:
int a,b;
};
class ss:c
{
int aa;
};
int main()
{
ss a;
cout<<sizeof(a)<<endl;//Output 20(4*(2+2+1)) When inheriting, the private content of the father is also inherited.
return 0;
}
using namespace std;
class c{
private:
int real,imag;
public:
int a,b;
};
class ss:c
{
int aa;
};
int main()
{
ss a;
cout<<sizeof(a)<<endl;//Output 20(4*(2+2+1)) When inheriting, the private content of the father is also inherited.
return 0;
}