How do you delete an object in C++?

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.

Sizin İçin Seçtik  Can you call destructor?

Leave a Reply

Your email address will not be published. Required fields are marked *