#include<iostream>
using namespace std;
class X
{
int x;
public:
int y;
protected:
int z;
};
class Y : public X
{
int a;
public:
int b;
protected:
int c;
};
int main()
{
cout<<sizeof(Y);
return 0;
}
According the output (24 on my machine) , even the variable x which was private in class X is being considered as a part of class Y?
Please explain!