[C++]豆知识(1条)

术语:

  • ctor:constructor,构造函数
  • dtor:destructor,析构函数

构造函数/析构函数

  1. 如果基类要利用多态,则dtor需要声明为virtual,这样在销毁对象时才可以正确调用析构函数。
原文地址:https://www.cnblogs.com/SelaSelah/p/3901557.html