Free memory from process space
<p>following is the code:</p>

<pre><code>class x
{
    int k;
};
int main()
{
    x *p=new x[1000000];
    return 0;// can be  1 too
}
</code></pre>

<p>now question is when we come out of the main function the memory allocated is freed       by   compiler calling destructor or it is freed by the operating system as process will no longer exist.?</p>
