Location of members of an object
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/187797/are-data-members-allocated-in-the-same-memory-space-as-their-objects-in-c">Are data members allocated in the same memory space as their objects in C++?</a>  </p>
</blockquote>



<p>If I declare an object like this:</p>

<pre><code>void main() {
  MyClass class;
}
</code></pre>

<p>it will be created automatically on the stack.</p>

<p>What happens if I do this:</p>

<pre><code>class MySecondClass {
  private:
    MyClass class;
}
</code></pre>

<p>Will the member be created on the stack? If so, what happens if <code>MySecondClass</code> is created via <code>new</code>? Will this member still be on the stack?</p>
