Here is the code
It's interesting to see the size of A1 and A2 are different just because you give A2.B a name! Why is THAT?Code:struct A1{
char b;
struct {
char c;
char a;
};
};
cout<<sizeof(A1)<<endl;
struct A2{
char b;
struct B{
char c;
char a;
};
};
cout<<sizeof(A2)<<endl;