Why do class members have the same address as their object?
<p>In the following cases, each member has a different name or entity so why are their addresses the same? </p>

<pre><code>struct B { int x; };
struct A { B b; };

int main()
{
    A obj;
    cout &lt;&lt; &amp;obj.b.x &lt;&lt; endl;
    cout &lt;&lt; &amp;obj.b &lt;&lt; endl;
    cout &lt;&lt; &amp;obj &lt;&lt; endl;
}
</code></pre>
