What does delete[] do if given a pointer to the middle of an array?
<p>What would happen in the following code?</p>

<pre><code>    int *p1 = new int[100];
    int *p2 = &amp;p1[50];
    delete [] p2;
</code></pre>

<p>I've heard that some implementations of new store the size of the array in the (-1)th array index, but then wouldn't things go horribly wrong in the above?</p>
