- 博客(3)
- 资源 (1)
- 收藏
- 关注
原创 C++继承机制
1. 构造函数。 The base-class object is constructed first. 1. 首先构造基类对象。 The derived-class constructor should pass base-class information to a base-class constructor via a member initializer list. 2. 继承类
2015-11-17 20:19:37 328
原创 默认构造函数
Default Constructor: C++ Compiler generates automatically if you don't define one. 以class Time为例 : 系统自生成默认构造函数为: Time::Time() {} // implicit and does nothing 定义一个类变量时: Time curTime; // 类没有初始化 自定
2015-11-11 20:05:54 400
原创 运算符重载与友元
Keep in mind that you must choose one or the other form when defining a given operator,but not both. 加法:operator+ 以class Time为例: T1 = T2 + T3; --> T1 = T2.operator+(T3); // member function --> T1
2015-11-10 20:42:34 301
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人