Destructor Questions..

I'm a bit confused about destructors. I understand their functionality and why they are important... However, consider the following code in my base class:

1
2
3
4
virtual ~Employee()
virtual void ~calcPay()=0;
virtual void writeData();
virtual void readData();


Do I need a destructor in all of my derived classes?

Also, do I need to do anything special to these functions at implementation?
Last edited on
No and no.
I think you do need a destructor for your derived class. As I remember, constructor and destructor are not inherited. Correct me if I am wrong.
They are "inherited" in that the derived class must be able to call the base's constructors and destructor.
They are inherited as jsmith said and don't need to be implemented because the compiler will provide one if one isn't defined.
Topic archived. No new replies allowed.