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

术语:函数

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

构造函数/析构函数对象

  1. 若是基类要利用多态,则dtor须要声明为virtual,这样在销毁对象时才能够正确调用析构函数。
相关文章
相关标签/搜索