<snip>int *pHeap = new int;*pHeap = 7;delete pHeap;pHeap = new int;*pHeap = 9;delete pHeap;
The explanation of this code says that the last delete is redundant. "The end of the program would have returned that memory".
From my understanding of the heap, everytime you allocate space using new you have to delete it explicity. Why is this last delete redundant?