Compiler: How is class instantiation code compiled?
<p>Assume we have (in C++): <code>MyClass* x = new MyClass(10)</code></p>

<p>Can someone please explain what 'exactly' happens when compiler parses this statement? (I tried taking a look at the Red Dragon book but couldn't find anything useful).</p>

<p>I want to know what happens in the stack/heap or compiler's symbol table. How compiler keeps track of the type of <code>x</code> variable? How later calls to <code>x-&gt;method1(1,2)</code> will be resolved to appropriate methods in MyClass (for simplicity assume there is no inheritance and <code>MyClass</code> is the only class that we have).</p>