The standard does not say anything about how the memory will be deleted - it simply says that it does not correspond to the correct new with the correct deletion - this is undefined behavior.
In fact, new[] , followed by delete , usually frees up all the memory that was allocated with new[] , but destructors for elements in this array are not called correctly. (Most of the time is not what the standard requires)
Instead of dynamically allocated arrays, you should consider using vector .
Billy oneal
source share