Do these two structs have the same memory layout? (C++)
struct A
{
int x;
char y;
double z;
};
struct B
{
A a;
};
Further can I access x, y, z members if I manually cast an object of this to an A
?
struct C
{
A a;
int b;
};
Thanks in advance.
EDIT:
What if they were classes
instead of structs
?