title: Is it better to use heap or stack variables?
body: <p>An experienced C++ user told me that I should strive for using heap variables, i.e.:</p>
  <pre><code>A* obj = new A(&quot;A&quot;);
  </code></pre>
  <p>as opposed to:</p>
  <pre><code>A obj(&quot;A&quot;);
  </code></pre>
  <p>Aside from all that stuff about using pointers being nice and flexible, he said it's better to put things on the heap rather than the stack (something about the stack being smaller than the heap?). Is it true? If so why?</p>
  <p>NB: I know about issues with lifetime. Let's assume I have managed the lifetime of these variables appropriately. (i.e. the only criteria of concern is heap vs. stack storage with no lifetime concern)</p>