Amazon Interview Question
Developer Program EngineersCompilers are responsible for calling destructors as well as constructors when object is deleted or created respectively ). So in case of virtual destructors compiler makes sure both derived class followed by base called descrutors are called i.,e in reverse order of creation. This would ensure cleanup of the object completely and cleanely
-Virtual destructor doesn't need V-table creation.
-Destructor can't be override in child class.
-If you are making it pure virtual, you have to provide definition in base class itself.
Normal virtual function never call base functions where as virtual destructor call base virtual destructor in Epilog.
- Ashish February 14, 2011