Why do we even need the “delete[]” operator?
It’s so that the destructors of the individual elements will be called. Yes, for arrays of PODs, there isn’t much of a difference, but in C++, you can have arrays of objects with non-trivial destructors. Now, your question is, why not make new and delete behave like new[] and delete[] and get rid of new[] … Read more