让C++代码变的更加健壮

1631阅读 0评论2011-11-03 jian_g_
分类:C/C++

 

1. nitializing Local Variables (局部变量初始化)

2. Initializing WinAPI Structures

3. Validating Function Input

4. Initializing Function Output

5. Cleaning Up Pointers to Deleted Objects

6. Cleaning Up Released Handles

7. Using delete [] Operator for Arrays

8. Allocating Memory Carefully

9. Using Asserts Carefully

10. Checking Return Code of a Function

11. Using Smart Pointers

12. Using == Operator Carefully

 

from: http://blog.jobbole.com/4622/

 

Secure Coding Best Practices for Memory Allocation in C and C++

 

上一篇:比较二进制文件的不同
下一篇:c10k问题