FlexTrade Interview Question
Software Engineer / DevelopersIn particular, here's when you need to make your destructor virtual:
* if someone will derive from your class,
* and if someone will say new Derived, where Derived is derived from your class,
* and if someone will say delete p, where the actual object's type is Derived but the pointer p's type is your class.
More info : www parashift com/c++-faq-lite/virtual-functions.html#faq-20.7
To ensure that proper destructor is called through base pointer goes out of scope.
- netappreject July 28, 2010