Book description
It’s easy to make lots of programming mistakes in C++—in fact, any program over a few hundred lines is likely to contain bugs. With this book, you’ll learn about many common coding errors that C++ programmers produce, along with rules and strategies you can use to avoid them. You’ll not only find recipes for identifying errors during your program’s compilation, runtime, and testing phases, you’ll learn a comprehensive approach for making your C++ code safe and bug-free.
Table of contents
- Safe C++
- Dedication
- SPECIAL OFFER: Upgrade this ebook with O’Reilly
- Preface
- I. A Bug-Hunting Strategy for C++
-
II. Bug Hunting: One Bug at a Time
- 4. Index Out of Bounds
- 5. Pointer Arithmetic
- 6. Invalid Pointers, References, and Iterators
- 7. Uninitialized Variables
- 8. Memory Leaks
- 9. Dereferencing NULL Pointers
- 10. Copy Constructors and Assignment Operators
- 11. Avoid Writing Code in Destructors
- 12. How to Write Consistent Comparison Operators
- 13. Errors When Using Standard C Libraries
-
III. The Joy of Bug Hunting: From Testing to Debugging to Production
- 14. General Testing Principles
- 15. Debug-On-Error Strategy
- 16. Making Your Code Debugger-Friendly
- 17. Conclusion
- A. Source Code for the scpp Library Used in This Book
- B. Source Code for the files scpp_assert.hpp and scpp_assert.cpp
- C. Source Code for the file scpp_vector.hpp
- D. Source Code for the file scpp_array.hpp
- E. Source Code for the file scpp_matrix.hpp
- F. Source Code for the file scpp_types.hpp
- G. Source Code for the file scpp_refcountptr.hpp
- H. Source Code for the file scpp_scopedptr.hpp
- I. Source Code for the file scpp_ptr.hpp
- J. Source Code for the file scpp_date.hpp and scpp_date.cpp
- Index
- About the Author
- Colophon
- SPECIAL OFFER: Upgrade this ebook with O’Reilly
- Copyright
Product information
- Title: Safe C++
- Author(s):
- Release date: June 2012
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449320935
You might also like
book
40 Algorithms Every Programmer Should Know
Learn algorithms for solving classic computer science problems with this concise guide covering everything from fundamental …
book
Modern C++ Programming Cookbook - Second Edition
A pragmatic recipe book for acquiring a comprehensive understanding of the complexities and core fundamentals of …
book
The Linux Programming Interface
The Linux Programming Interface is the definitive guide to the Linux and UNIX programming interface—the interface …
book
Software Engineering at Google
Today, software engineers need to know not only how to program effectively but also how to …