How many types of destructor are there in C++?

There has to be only one Destructor in a class . A Destructor has no return type and no parameters. If we do specify a destructor in class then, the compiler creates a default destructor. The default destructor works fine unless memory is dynamically allocated or pointer is declared in the class.

Sizin İçin Seçtik  What is inheritance explain with example in Python?

Leave a Reply

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