Tuesday, 17 April 2012

What would happen on forgetting [], while deallocating an array through new? | C++

If you forget to use [] while deallocating an array through new, it throws a run time or compile time exception and results in the corruption of the heap.Therefore, it is the responsibility of the programmer to establish the connection between T[n] and delete[]p correctly.

No comments: