Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ Pointer Objects vs. Non Pointer Objects
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/1549945/why-would-you-ever-want-to-allocate-memory-on-the-heap-rather-than-the-stack">Why would you ever want to allocate memory on the heap rather than the stack?</a> </p> </blockquote> <pre><code>Test2 *t2 = new Test2(); t2-&gt;test(); Test2 t3; t3.test(); </code></pre> <p>Why would I want to create a pointer object of type Test2? Why not just do non pointer version of Test2? Why would I want to do pointer objects?</p> <p>Found answer here:</p> <ul> <li><a href="https://stackoverflow.com/questions/1549945/why-would-you-ever-want-to-allocate-memory-on-the-heap-rather-than-the-stack">Why would you ever want to allocate memory on the heap rather than the stack?</a></li> <li><a href="https://stackoverflow.com/questions/102009/when-is-it-best-to-use-a-stack-instead-of-a-heap-and-vice-versa">When is it best to use a stack instead of a heap and vice versa?</a></li> <li><a href="https://stackoverflow.com/questions/679571/when-to-use-new-and-when-not-to-in-c">When to use "new" and when not to in C++?</a></li> <li><a href="https://stackoverflow.com/questions/655065/when-should-i-use-the-new-keyword-in-c">When should I use the new keyword in C++?</a></li> <li><a href="https://stackoverflow.com/questions/599308/proper-stack-and-heap-usage-in-c">Proper stack and heap usage in C++</a></li> <li><a href="https://stackoverflow.com/questions/408670/stack-static-and-heap-in-c">Stack, Static and Heap in C++</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload