Which one of the following statements is correct?
A.
A virtual destructor is required in any class with pure virtual member
functions.
B.
A virtual destructor needs to be written in any classes with a virtual
constructor.
C.
A base class must have a virtual destructor when someone uses a base class
pointer to delete a derived class object.
D.
Virtual destructors are obsolete and should never be used except in legacy
code.
E.
Every class must have a virtual destructor.
A 为什么不对呢?
l******l 发帖数: 66
2
The answer C explains it. It has nothing to do with other virtual function.
l*******t 发帖数: 48
3
It is OK a class with pure virtual member functions has no virtual
destructor. A is incorrect so!