高质量 C++/C 编程指南,v 1.0
2001 Page 4 of 101
6.1 参数的规则 ...................................................................................................................8
6.2
返回值的规则 ...............................................................................................................8
6.3
函数内部实现的规则....................................................................................................8
6.4
其它建议 .......................................................................................................................8
6.5
使用断言 .......................................................................................................................8
6.6
引用与指针的比较........................................................................................................8
第 7 章 内存管理....................................................................................................................8
7.1 内存分配方式................................................................................................................8
7.2 常见的内存错误及其对策.............................................................................................8
7.3 指针与数组的对比 ........................................................................................................8
7.4 指针参数是如何传递内存的?.....................................................................................8
7.5
FREE 和 DELETE 把指针怎么啦?.................................................................................8
7.6
动态内存会被自动释放吗?........................................................................................8
7.7
杜绝“野指针” ...........................................................................................................8
7.8
有了 MALLOC/FREE 为什么还要 NEW/DELETE ?.......................................................8
7.9
内存耗尽怎么办?........................................................................................................8
7.10
MALLOC/FREE 的使用要点.........................................................................................8
7.11
NEW/DELETE 的使用要点 ...........................................................................................8
7.12
一些心得体会 .............................................................................................................8
第 8 章 C++函数的高级特性.................................................................................................8
8.1
函数重载的概念 ...........................................................................................................8
8.2
成员函数的重载、覆盖与隐藏....................................................................................8
8.3
参数的缺省值 ...............................................................................................................8
8.4 运算符重载 ...................................................................................................................8
8.5
函数内联 .......................................................................................................................8
8.6
一些心得体会 ...............................................................................................................8
第 9 章 类的构造函数、析构函数与赋值函数.....................................................................8
9.1
构造函数与析构函数的起源........................................................................................8
9.2
构造函数的初始化表....................................................................................................8
9.3
构造和析构的次序........................................................................................................8
9.4
示例:类 STRING 的构造函数与析构函数..................................................................8
9.5
不要轻视拷贝构造函数与赋值函数 ............................................................................8
9.6
示例:类 STRING 的拷贝构造函数与赋值函数 ..........................................................8
9.7
偷懒的办法处理拷贝构造函数与赋值函数.................................................................8
9.8
如何在派生类中实现类的基本函数 ............................................................................8
9.9
一些心得体会 ...............................................................................................................8
第 10 章 类的继承与组合......................................................................................................8