The constructor attribute causes the function to be called automatically before execution enters main (). Similarly, the destructor attribute causes the function to be called automatically after main () completes or exit () is called. Functions with these attributes are useful for initializing data that is used implicitly during the execution of the program.
构造函数属性使函数在执行进入main()之前自动被调用。同样,析构函数属性使函数在main()完成或调用exit()之后自动被调用。具有这些属性的函数对于初始化在程序执行期间隐式使用的数据很有用。
————————————————
版权声明:本文为CSDN博主「沙diao网友」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/moX980/article/details/107890046