找回密码
 注册
搜索
查看: 1358|回复: 2

[资料] 高质量c/C++编程指南

[复制链接]
发表于 2006-3-31 19:29:00 | 显示全部楼层 |阅读模式
林锐 博士写的,浏览了一下,讲了很多应该注意的地方,对新手还是不错的
目 录
前 言......................................................................................................................................6
第1 章 文件结构....................................................................................................................8
1.1 版权和版本的声明........................................................................................................8
1.2 头文件的结构...............................................................................................................8
1.3 定义文件的结构...........................................................................................................8
1.4 头文件的作用...............................................................................................................8
1.5 目录结构.......................................................................................................................8
第2 章 程序的版式................................................................................................................8
2.1 空行...............................................................................................................................8
2.2 代码行...........................................................................................................................8
2.3 代码行内的空格...........................................................................................................8
2.4 对齐...............................................................................................................................8
2.5 长行拆分.......................................................................................................................8
2.6 修饰符的位置...............................................................................................................8
2.7 注释...............................................................................................................................8
2.8 类的版式.......................................................................................................................8
第3 章 命名规则....................................................................................................................8
3.1 共性规则.......................................................................................................................8
3.2 简单的WINDOWS 应用程序命名规则.........................................................................8
3.3 简单的UNIX 应用程序命名规则..................................................................................8
第4 章 表达式和基本语句....................................................................................................8
4.1 运算符的优先级...........................................................................................................8
4.2 复合表达式...................................................................................................................8
4.3 IF 语句...........................................................................................................................8
4.4 循环语句的效率...........................................................................................................8
4.5 FOR 语句的循环控制变量............................................................................................8
4.6 SWITCH 语句..................................................................................................................8
4.7 GOTO 语句......................................................................................................................8
第5 章 常量............................................................................................................................8
5.1 为什么需要常量...........................................................................................................8
5.2 CONST 与 #DEFINE 的比较...........................................................................................8
5.3 常量定义规则...............................................................................................................8
5.4 类中的常量...................................................................................................................8
第6 章 函数设计....................................................................................................................8
高质量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
高质量C++/C 编程指南,v 1.0
2001 Page 5 of 101
10.1 继承.............................................................................................................................8
10.2 组合.............................................................................................................................8
第11 章 其它编程经验..........................................................................................................8
11.1 使用CONST 提高函数的健壮性..................................................................................8
11.2 提高程序的效率..........................................................................................................8
11.3 一些有益的建议..........................................................................................................8
参考文献................................................................................................................................8
附录A :C++/C 代码审查表................................................................................................8
附录B :C++/C 试题............................................................................................................8
附录C :C++/C 试题的答案与评分标准.............................................................................8

【文件名】:06331@52RD_高质量c编程指南.pdf
【格 式】:pdf
【大 小】:333K
【简 介】:
【目 录】:


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
发表于 2006-4-3 11:17:00 | 显示全部楼层
<P>支持一下,不错的文章!</P>
点评回复

使用道具 举报

发表于 2010-5-26 08:30:00 | 显示全部楼层
zhi chi
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-12-25 09:45 , Processed in 0.045768 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表