Releasing memory (if possible)
<p>Can I release the memory that was used to allocate the object? If so, how can I do it?         </p>

<pre><code>class CRectangle {
    int width, height;
public:
    CRectangle (int,int);
    ~CRectangle ();
    int area () {
        return (width * height);
    }
};

CRectangle::CRectangle (int a, int b) {
    width = a;
    height = b;
}

CRectangle::~CRectangle () {
    // Do something here
}
</code></pre>

<p>If i used dynamic memory allocation it will be:</p>

<pre><code>   class CRectangle {
        int *width, *height;
    public:
        CRectangle (int,int);
        ~CRectangle ();
        int area () {
            return (*width * *height);
        }
    };

    CRectangle::CRectangle (int a, int b) {
        width = new int;
        height = new int;
        *width = a;
        *height = b;

    }

    CRectangle::~CRectangle () {
        delete width
        delete height
    }
</code></pre>

<p>They do have same output, so what's the advantage of using dynamic memory allocation?</p>
