Safe C++: How to avoid common mistakes pdf

140 982 3
Safe C++: How to avoid common mistakes pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... least easy to catch In Part III we apply all the rules and code of the Safe C++ library introduced in Part II and discuss the testing strategy that shows how to catch bugs in the most efficient manner Preface | xi We also discuss how to make your program “debuggable.” One of the goals when writing a program is to make it easy to debug, and we will show how our proposed use of error handling adds to our... that lets the compiler know how to convert an Apple into an Orange is to provide a conversion operator: class Apple { public: // constructors and other code … operator Orange () const; }; The very presence of this operator suggests that the programmer made an explicit effort to provide the compiler with a way to convert Apple into Orange, and therefore it might not be a mistake However, the absence of... argc, char* argv[]) { cout . also discuss how to make your program “debuggable.” One of the goals when writing a program is to make it easy to debug, and we will show how our proposed. trouble understanding such concepts as the constructor, copy-constructor, assignment operator, destructor, operator overloading, virtual functions, exceptions, etc.

Ngày đăng: 14/03/2014, 23:20

Từ khóa liên quan

Mục lục

  • Table of Contents

  • Preface

    • Audience

    • How This Book Is Organized

    • Conventions Used in This Book

    • Naming Conventions

    • Using Code Examples

    • Safari® Books Online

    • How to Contact Us

    • Acknowledgments

    • Part I. A Bug-Hunting Strategy for C++

      • Chapter 1. Where Do C++ Bugs Come From?

      • Chapter 2. When to Catch a Bug

        • Why the Compiler Is Your Best Place to Catch Bugs

        • How to Catch Bugs in the Compiler

        • The Proper Way to Handle Types

        • Chapter 3. What to Do When We Encounter an Error at Runtime

        • Part II. Bug Hunting: One Bug at a Time

          • Chapter 4. Index Out of Bounds

            • Dynamic Arrays

            • Static Arrays

            • Multidimensional Arrays

            • Chapter 5. Pointer Arithmetic

            • Chapter 6. Invalid Pointers, References, and Iterators

            • Chapter 7. Uninitialized Variables

              • Initialized Numbers (int, double, etc.)

Tài liệu cùng người dùng

Tài liệu liên quan