In C++, the single object of the class which is created at runtime using a new operator is deleted by using the delete operator , while the array of objects is deleted using the delete[] operator so that it cannot lead to a memory leak.
In C++, the single object of the class which is created at runtime using a new operator is deleted by using the delete operator , while the array of objects is deleted using the delete[] operator so that it cannot lead to a memory leak.