Why do we need pure virtual destructor in C++?

It is must to provide a function body for pure virtual destructor as derived class’s destructor is called first before the base class destructor, so if we do not provide a function body, it will find out nothing to be called during object destruction and error will occur.

Sizin İçin Seçtik  Can someone mine Bitcoin for free?

Leave a Reply

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