Why do we need a destructor in C++?

Destructors are usually used to deallocate memory and do other cleanup for a class object and its class members when the object is destroyed . A destructor is called for a class object when that object passes out of scope or is explicitly deleted.

Sizin İçin Seçtik  Ledger cüzdan güvenli mi?

Leave a Reply

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