2016年10月8日

构造函数参数和类的数据成员同名时的两种写法

摘要: #include using namespace std; class Base { public: Base(int x) : x(x)//成员初始化列表中不需要也不能够用this指针指出数据成员 { } int x; }; class Base1 { public: Base1(int x) { this->x = ... 阅读全文

posted @ 2016-10-08 10:53 lakeone 阅读(1879) 评论(0) 推荐(0) 编辑

导航