Dynamically allocating memory on stack
<p>There is such code:</p>

<pre><code>#include &lt;iostream&gt;

int main()
{
    int a;
    int* p = new (&amp;a) int(2);
    std::cout &lt;&lt; a &lt;&lt; std::endl;
    // delete p; error BLOCK TYPE IS INVALID
    std::cin.get();
    return 0;
}
</code></pre>

<p>The output is:</p>

<pre><code>2
</code></pre>

<p>Why is it possible to dynamically allocate memory on stack? (I thought that heap is the right place to do this). And, why does delete operator return error in this case, but new operator work?</p>
