virtual keyword in different scenarios
- by Mahesh
I figured out 2 different meanings for virtual based on the situation it is being used.
If a baseClass has a function defined virtual, then the derivedClass is going to override the function.
The baseClass::~baseClass() should be defined virtual, if there is any class derived from it. Here it means, the derived class destruction first takes place followed by base class destruction.
Are there any other situations where virtual hold a different meaning ?