InterviewSolution
Saved Bookmarks
| 1. |
What Would Happen On Forgetting [], While Deallocating An Array Through New? |
|
Answer» 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. 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. |
|