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.

Surya.T said:   1 decade ago
What is mean by virtual function?

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.


Post your comments here:

Your comments will be displayed after verification.