C++高级——探秘对象构造和析构(一)

探秘对象构造和析构(一) 首先咱们先看咱们的类代码:程序员 class Test { public: //带一个整型参数的构造函数 Test(int a = 10) :ma(a) { cout << "Test(int)" << endl; } //析构函数 ~Test() { cout << "~Test()" << endl; } //拷贝
相关文章
相关标签/搜索