C++ Memory Management diffrences with Heap Allocation and Frame Allocation
<p>I am slightly confused about how memory management works in C++, I understand when you use pointers (new/delete) but I'm lost when it comes to Frame allocation.</p>

<p>Say I have a simple class (Using QT Classes)</p>

<pre><code>class Demo {
    public:
        Demo();
        ~Demo();
        QString AString() const;
        void setAString(const QString &amp;value);
    private:
        QString aString;
};
</code></pre>

<p>And I Allocate it using a pointer</p>

<pre><code>Demo *testInst = new Demo();
</code></pre>

<p>Now I understand when i call "delete testInst;" That is freed, but I'm confused about the out of scope part on Frame Allocations. Does that mean when I call delete, all those in the class that are not pointers are automatically freed, or do i have to do specific memory management within the deconstructor of the Demo class? Or does it mean if I leave the class those variables are freed?</p>

<p>I'm new to C++ and came from a .NET background so I'm not 100% understanding of manual memory management.</p>
