You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// When a Derived class object is created, the base constructor is called first followed by derived constructor then, derived destructor is called followed by base destructor
// When we create a Base class pointer to Derived class object, first Base class Constructor is called followed by Derived class constructor.
// But when we free the pointer, only Base destructor is executed. In order for Derived class destructor to get executed we need to declare the Base class destructor as "virtual"