In the following cases, each member has a different name or entity so why are their addresses the same?
struct B { int x; };
struct A { B b; };
int main()
{
A obj;
cout << &obj.b.x << endl;
cout << &obj.b << endl;
cout << &obj << endl;
}
See Question&Answers more detail:os