#include
using namespace std;
class Base {
public:
Base() { cout<<"Constructor: Base"<
(一种)
Constructor: Base
Constructor: Derived
Destructor : Derived
Destructor : Base
(B)
Constructor: Base
Constructor: Derived
Destructor : Base
(C)
Constructor: Base
Constructor: Derived
Destructor : Derived
(D)
Constructor: Derived
Destructor : Derived
答案: (A)
说明:由于析构函数是虚拟的,因此将调用派生类析构函数,后者又调用基类析构函数。
这个问题的测验
想要从精选的最佳视频中学习和练习问题,请查看《基础知识到高级C的C基础课程》。