Does delete[] a
, where a
is dynamic-allocated array of pointers, execute delete
for each pointer in array?
I suppose, it executes destructor for arrays with user-defined classes, but what's happening with pointers?
No, delete []
is used to delete an array. If you need to delete array elements, you need to call delete
on each one of them.