Table of Contents

Introduction

What Is C++?

How C++ Works

What You’ll Need

About This Book

Getting Help

Chapter 1. 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

Chapter 2. 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

Chapter 3. 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

Chapter 4. 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

Chapter 5. 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

Chapter 6. Complex Data Types

Working with Arrays

Working with Pointers

Structures

Revisiting User-Defined Functions

Chapter 7. Introducing Objects

Creating a Simple Class

Adding Methods to a Class

Creating and Using Objects

Defining Constructors

Defining Destructors

The this Pointer

Chapter 8. Class Inheritance

Basic Inheritance

Inheriting Constructors and Destructors

Access Control

Overriding Methods

Overloading Methods

Making Friends

Chapter 9. Advanced OOP

Static Attributes and Methods

Virtual Methods

Abstract Methods

Operator Overloading

The << Operator

Multiple Inheritance

Virtual Inheritance

Chapter 10. Error Handling and Debugging

Debugging Techniques

Returning Error Codes

Using assert()

Catching Exceptions

Chapter 11. 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

Chapter 12. Namespaces & Modularization

Working with Included Files

The C Preprocessor

Understanding Namespaces

Linkage and Scope

Chapter 13. Working with Templates

Basic Template Syntax

Creating Inline Templates

Containers and Algorithms

Chapter 14. Extended Topics

Strings Revisited

Working with Binary Files

Taking Command-Line Arguments

Appendix A. C++ Tools

Dev-C++ for Windows

Xcode on Mac OS X

Unix Tools

Debugging with GDB

Appendix B. Resources

Web Sites

Tables

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.151.220