What is the order in which the destructors and the constructors are called in C++

后端 未结 5 1047
执笔经年
执笔经年 2020-12-07 16:48

What is the order in which the destructors and the constructors are called in C++? Using the examples of some Base classes and Derived Classes

5条回答
  •  佛祖请我去吃肉
    2020-12-07 17:24

    Also, keep in mind that while array elements are constructed first -> last, they are destructed in the reverse order: last -> first.

提交回复
热议问题