Book description
Enter the world of computer programming with this step-by-step guide to the C++ language! C++ is a great introduction to object-oriented programming, and this friendly guide covers everything you need to know and nothing you don’t. You’ll write your first program by the end of Chapter 1.
C++ For Dummies, 6th Edition, helps you understand C++ programming from the ground up. It’s full of examples to show you how things work, and it even explains “why”, so you understand how the pieces fit together. And the bonus CD includes a special code editor, an update GNU compiler, and all source code from the book to save you time.
Learn programming lingo and what terms like object-oriented, compiler, and executable mean, so you can write a program right away
See how to bundle sections of your code into modules that can be reused in different programs
Work with features of object-oriented programming such as classes, constructors, and destructors
Discover how the concept of inheritance is the key to effective C++ programming
Work with assignment operators, stream I/O, and other more advanced concepts, once you’ve grasped the basics
You’ll discover ten ways to avoid adding bugs to your programs, what pointers are and how to use them, how to work with strings, and some advanced features new to C++. C++ For Dummies, 6th Edition gets you up and running with this popular object-oriented language.
Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.
Table of contents
- Copyright
- About the Author
- Acknowledgments
- Publisher's Acknowledgments
-
Introduction
- What's in This Book
- What's on the CD
- What Is C++?
- Conventions Used in This Book
- How This Book Is Organized
- And There's More
- Part I: Introduction to C++ Programming
- Part II: Becoming a Functional C++ Programmer
- Part III: Introduction to Classes
- Part IV: Inheritance
- Part V: Optional Features
- Part VI: The Part of Tens
- Icons Used in This Book
- Where to Go from Here
-
I. Introduction to C++ Programming
- 1. Writing Your First C++ Program
- 2. Declaring Variables Constantly
- 3. Performing Mathematical Operations
- 4. Performing Logical Operations
- 5. Controlling Program Flow
-
II. Becoming a Functional C++ Programmer
- 6. Creating Functions
- 7. Storing Sequences in Arrays
- 8. Taking a First Look at C++ Pointers
-
9. Taking a Second Look at C++ Pointers
-
9.1. Defining Operations on Pointer Variables
- 9.1.1. Reexamining arrays in light of pointer variables
- 9.1.2. Applying operators to the address of an array
- 9.1.3. Expanding pointer operations to a string
- 9.1.4. Justifying pointer-based string manipulation
- 9.1.5. Applying operators to pointer types other than char
- 9.1.6. Contrasting a pointer with an array
- 9.2. When Is a Pointer Not?
- 9.3. Declaring and Using Arrays of Pointers
-
9.1. Defining Operations on Pointer Variables
- 10. The C++ Preprocessor
-
III. Introduction to Classes
- 11. Examining Object-Oriented Programming
-
12. Adding Class to C++
- 12.1. Introducing the Class
- 12.2. The Format of a Class
- 12.3. Accessing the Members of a Class
- 12.4. Activating Our Objects
- 12.5. Adding a Member Function
- 12.6. Calling a Member Function
- 12.7. Scope Resolution (And I Don't Mean How Well Your Microscope Works)
- 12.8. Defining a Member Function in the Class
- 12.9. Keeping a Member Function After Class
- 12.10. Overloading Member Functions
-
13. Point and Stare at Objects
- 13.1. Declaring Arrays of Objects
- 13.2. Declaring Pointers to Objects
- 13.3. Passing Objects to Functions
- 13.4. Why Bother with Pointers or References?
- 13.5. Returning to the Heap
- 13.6. Comparing Pointers to References
- 13.7. Linking Up with Linked Lists
- 13.8. A Ray of Hope: A List of Containers Linked to the C++ Library
- 14. Protecting Members: Do Not Disturb
- 15. Why Do You Build Me Up, Just to Tear Me Down Baby?
-
16. Making Constructive Arguments
- 16.1. Outfitting Constructors with Arguments
- 16.2. Placing Too Many Demands on the Carpenter: Overloading the Constructor
- 16.3. Defaulting Default Constructors
- 16.4. Constructing Class Members
-
16.5. Reconstructing the Order of Construction
- 16.5.1. Local objects construct in order
- 16.5.2. Static objects construct only once
- 16.5.3. All global objects construct before main()
- 16.5.4. Global objects construct in no particular order
- 16.5.5. Members construct in the order in which they are declared
- 16.5.6. Destructors destruct in the reverse order of the constructors
- 16.6. Constructors as a Form of Conversion
- 17. Copying the Copy Copy Copy Constructor
- 18. Static Members: Can Fabric Softener Help?
- IV. Inheritance
-
V. Optional Features
- 22. A New Assignment Operator, Should You Decide to Accept It
- 23. Using Stream I/O
- 24. Handling Errors — Exceptions
- 25. Inheriting Multiple Inheritance
- 26. Tempting C++ Templates
- 27. Standardizing on the Standard Template Library
-
VI. The Part of Tens
-
28. Ten Ways to Avoid Adding Bugs to Your Program
- 28.1. Enable All Warnings and Error Messages
- 28.2. Adopt a Clear and Consistent Coding Style
- 28.3. Limit the Visibility
- 28.4. Comment Your Code While You Write It
- 28.5. Single-Step Every Path at Least Once
- 28.6. Avoid Overloading Operators
- 28.7. Manage the Heap Systematically
- 28.8. Use Exceptions to Handle Errors
- 28.9. Declare Destructors Virtual
- 28.10. Avoid Multiple Inheritance
-
29. Ten Major Recent Additions to C++
- 29.1. Use Smart Pointers
- 29.2. Initialize Variables with a Variable-Length List
- 29.3. Initialize Data Members Inline
- 29.4. Instantiate an Extern Template
- 29.5. Implement Thread Local Storage
- 29.6. Use Rvalue References
- 29.7. Implement Concepts
- 29.8. Define Lamda Expressions
- 29.9. Define Variadic Templates
- 29.10. Use typeid()
-
28. Ten Ways to Avoid Adding Bugs to Your Program
- A. About the CD
Product information
- Title: C++ For Dummies®, 6th Edition
- Author(s):
- Release date: May 2009
- Publisher(s): For Dummies
- ISBN: 9780470317266
You might also like
book
Programming in C++, 2nd Edition
The revised and updated version of the student-friendly, practical and example-driven book, Programming in C++, continues …
book
Object-Oriented Programming in C++, Fourth Edition
Object-Oriented Programming in C++ begins with the basic principles of the C++ programming language and systematically …
book
Practical C++ Programming, 2nd Edition
C++ is a powerful, highly flexible, and adaptable programming language that allows software engineers to organize …
book
Professional C++, 4th Edition
Get up to date quickly on the new changes coming with C++17 Professional C++ is the …