| |
| |
Introduction | |
| |
| |
What Is C++? | |
| |
| |
How C++ Works | |
| |
| |
What You'll Need | |
| |
| |
About This Book | |
| |
| |
Getting Help | |
| |
| |
| |
Creating a Basic Program | |
| |
| |
Basic C++ Syntax | |
| |
| |
Compiling a C++ Program | |
| |
| |
Printing Text | |
| |
| |
Running a Compiled Program | |
| |
| |
Pausing Execution | |
| |
| |
Understanding White Space | |
| |
| |
Adding Comments to Your Source Code | |
| |
| |
Using an IDE | |
| |
| |
| |
Simple Variables and Data Types | |
| |
| |
Declaring Variables | |
| |
| |
Assigning Values to Variables | |
| |
| |
Printing Variables | |
| |
| |
Formatting Numbers | |
| |
| |
Understanding Type Conversion | |
| |
| |
Introduction to Characters | |
| |
| |
Introduction to Strings | |
| |
| |
Introduction to Constants | |
| |
| |
| |
Operators and Control Structures | |
| |
| |
Arithmetic Operators | |
| |
| |
If Conditionals | |
| |
| |
Using else and else if | |
| |
| |
The Ternary Operator | |
| |
| |
Logical and Comparison Operators | |
| |
| |
Switch Conditionals | |
| |
| |
Increment and Decrement Operators | |
| |
| |
While Loop | |
| |
| |
For Loop | |
| |
| |
| |
Input, Output, and Files | |
| |
| |
Taking Character Input | |
| |
| |
Discarding Input | |
| |
| |
Taking Numeric Input | |
| |
| |
Taking String Input | |
| |
| |
Taking Multiple Inputs | |
| |
| |
Reading In a Whole Line | |
| |
| |
Validating Input | |
| |
| |
Creating File Output | |
| |
| |
Using File Input | |
| |
| |
| |
Defining Your Own Functions | |
| |
| |
Creating Simple Functions | |
| |
| |
Creating Functions That Take Arguments | |
| |
| |
Setting Default Argument Values | |
| |
| |
Creating Functions That Return a Value | |
| |
| |
Overloading Functions | |
| |
| |
Understanding Variable Scope | |
| |
| |
| |
Complex Data Types | |
| |
| |
Working with Arrays | |
| |
| |
Working with Pointers | |
| |
| |
Structures | |
| |
| |
Revisiting User-Defined Functions | |
| |
| |
| |
Introducing Objects | |
| |
| |
Creating a Simple Class | |
| |
| |
Adding Methods to a Class | |
| |
| |
Creating and Using Objects | |
| |
| |
Defining Constructors | |
| |
| |
Defining Destructors | |
| |
| |
The this Pointer | |
| |
| |
| |
Class Inheritance | |
| |
| |
Basic Inheritance | |
| |
| |
Inheriting Constructors and Destructors | |
| |
| |
Access Control | |
| |
| |
Overriding Methods | |
| |
| |
Overloading Methods | |
| |
| |
Making Friends | |
| |
| |
| |
Advanced OOP | |
| |
| |
Static Attributes and Methods | |
| |
| |
Virtual Methods | |
| |
| |
Abstract Methods | |
| |
| |
Operator Overloading | |
| |
| |
The [double less-than sign] Operator | |
| |
| |
Multiple Inheritance | |
| |
| |
Virtual Inheritance | |
| |
| |
| |
Error Handling and Debugging | |
| |
| |
Debugging Techniques | |
| |
| |
Returning Error Codes | |
| |
| |
Using assert() | |
| |
| |
Catching Exceptions | |
| |
| |
| |
Dynamic Memory Management | |
| |
| |
Static and Dynamic Memory | |
| |
| |
Allocating Objects | |
| |
| |
Allocating Arrays of Dynamic Size | |
| |
| |
Returning Memory from a Function or Method | |
| |
| |
The Copy Constructor and the Assignment Operator | |
| |
| |
Static Object Type Casts | |
| |
| |
Performing Dynamic Object Type Casts | |
| |
| |
Avoiding Memory Leaks | |
| |
| |
| |
Namespaces & Modularization | |
| |
| |
Working with Included Files | |
| |
| |
The C Preprocessor | |
| |
| |
Understanding Namespaces | |
| |
| |
Linkage and Scope | |
| |
| |
| |
Working with Templates | |
| |
| |
Basic Template Syntax | |
| |
| |
Creating Inline Templates | |
| |
| |
Containers and Algorithms | |
| |
| |
| |
Extended Topics | |
| |
| |
Strings Revisited | |
| |
| |
Working with Binary Files | |
| |
| |
Taking Command-Line Arguments | |
| |
| |
| |
C++ Tools | |
| |
| |
Dev-C++ for Windows | |
| |
| |
Xcode on Mac OS X | |
| |
| |
Unix Tools | |
| |
| |
Debugging with GDB | |
| |
| |
| |
Resources | |
| |
| |
Web Sites | |
| |
| |
Tables | |
| |
| |
Index | |