creating object on stack/heap
<p>I have two piece of code that creates an A object</p>

<pre><code>A* a=new A();
</code></pre>

<p>AND</p>

<pre><code>A b; 
A *c=&amp;b;
</code></pre>

<p>The question is: someone says "objects are always allocated on heap"? </p>

<p>Is it true even declare it on stack?(Code 1)</p>

<p>Note: I am referring to the actual memory allocation. I know object 'b' will be</p>

<p>cleared when it goes out the the scope. But when it is still in scope, where does the </p>

<p>memory of 'b' actually reside?</p>
