In below program how d you release memory allocated to pointer p?
int *p = new int;
can use either option 1 or 3. both are same.
When you are allocating memory for an array of some elements, it is mandatory to use  operator with delete. Note: even if you don't use compiler or run-timer won't give any error, but your heap is likely to be corrupted.
Back To Top