What is destructor in C++ with syntax?

A destructor is a special member function that works just opposite to constructor , unlike constructors that are used for initializing an object, destructors destroy (or delete) the object. Syntax of Destructor ~class_name() { //Some code }

Sizin İçin Seçtik  Can a constructor takes arguments?

Leave a Reply

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