C++ Programming - Constructors and Destructors - Discussion

Discussion Forum : Constructors and Destructors - General Questions (Q.No. 3)
3.
Can a class have virtual destructor?
Yes
No
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
22 comments Page 3 of 3.

Swami vivekanand L. said:   1 decade ago
Destructor can be virtual because whenever the object goes in out of the scope then we have to delete it explicitly i.e. we need to call the destructor explicitly so destructor should made as virtual destructor like same as virtual function.

Padma said:   1 decade ago
How the destructor can be a virtual ?


Post your comments here:

Your comments will be displayed after verification.