What is the difference between delete and delete[] operators in C++?
delete
delete[]
delete is used for one single pointer and delete[] is used for deleting an array through a pointer. This might help you to understand better.