Anything wrong with this code? ......

Q

Anything wrong with this code?
T *p = new T[10];
delete p;

✍: Guest

A

Everything is correct, Only the first element of the array will be deleted”, The entire array will be deleted, but only the first element destructor will be called.

2012-03-02, 2676👍, 0💬