C++:建立对象的基本方法

建立对象有多种方法,其中包括普通的定义、经过拷贝函数初始化、new动态分配。ios #include <iostream> using namespace std; class ClsTest{ public: ClsTest(){} ClsTest(int d){ data = d; } void print(void) { cout << "Hello" << endl; } p
相关文章
相关标签/搜索