The speciality of a virtual destructor
A virtual function in a class, is one which allows modification of its functionality by the derived classes. But whats so special about a virtual destructor is that, when an object of a derived class is destroyed, both the base class destructor and the derived class destructor are invoked. This wont happen if the destructor of the base class is a non-virtual function.

0 Comments:
Post a Comment
<< Home