Table of Contents

Introduction

Part I: Beginning C++

HOUR 1: Writing Your First Program

Using C++

Finding a Compiler

Compiling and Linking the Source Code

Creating Your First Program

HOUR 2: Organizing the Parts of a Program

Reasons to Use C++

The Parts of a Program

Comments

Functions

HOUR 3: Creating Variables and Constants

What Is a Variable?

Defining a Variable

Assigning Values to Variables

Using Type Definitions

Constants

HOUR 4: Using Expressions, Statements, and Operators

Statements

Expressions

Operators

If-Else Conditional Statements

Logical Operators

Tricky Expression Values

HOUR 5: Calling Functions

What Is a Function?

Declaring and Defining Functions

Using Variables with Functions

Function Parameters

Returning Values from Functions

Default Function Parameters

Overloading Functions

HOUR 6: Controlling the Flow of a Program

Looping

while Loops

do-while Loops

for Loops

switch Statements

HOUR 7: Storing Information in Arrays and Strings

What Is an Array?

Writing Past the End of Arrays

Initializing Arrays

Multidimensional Arrays

Character Arrays

Copying Strings

Part II: Classes

HOUR 8: Creating Basic Classes

What Is a Type?

Creating New Types

Classes and Members

Accessing Class Members

Private Versus Public Access

Implementing Member Functions

Creating and Deleting Objects

HOUR 9: Moving into Advanced Classes

const Member Functions

Interface Versus Implementation

Organizing Class Declarations and Function Definitions

Inline Implementation

Classes with Other Classes as Member Data

Part III: Memory Management

HOUR 10: Creating Pointers

Understanding Pointers and Their Usage

The Stack and the Heap

HOUR 11: Developing Advanced Pointers

Creating Objects on the Heap

Deleting Objects

Accessing Data Members Using Pointers

Member Data on the Heap

The this Pointer

Stray or Dangling Pointers

const Pointers

const Pointers and const Member Functions

HOUR 12: Creating References

What Is a Reference?

Creating a Reference

Using the Address of Operator on References

What Can Be Referenced?

Null Pointers and Null References

Passing Function Arguments by Reference

Understanding Function Headers and Prototypes

Returning Multiple Values

HOUR 13: Developing Advanced References and Pointers

Passing by Reference for Efficiency

Passing a const Pointer

References as an Alternative to Pointers

When to Use References and When to Use Pointers

Don’t Return a Reference to an Object That Isn’t in Scope!

Returning a Reference to an Object on the Heap

Pointer, Pointer, Who Has the Pointer?

Part IV: Advanced C++

HOUR 14: Calling Advanced Functions

Overloaded Member Functions

Using Default Values

Initializing Objects

The Copy Constructor

HOUR 15: Using Operator Overloading

Operator Overloading

Conversion Operators

Part V: Inheritance and Polymorphism

HOUR 16: Extending Classes with Inheritance

What Is Inheritance?

Private Versus Protected

Constructors and Destructors

Passing Arguments to Base Constructors

Overriding Functions

HOUR 17: Using Polymorphism and Derived Classes

Polymorphism Implemented with Virtual Methods

How Virtual Member Functions Work

HOUR 18: Making Use of Advanced Polymorphism

Problems with Single Inheritance

Abstract Data Types

HOUR 19: Storing Information in Linked Lists

Linked Lists and Other Structures

Linked List Case Study

Linked Lists as Objects

Part VI: Special Topics

HOUR 20: Using Special Classes, Functions, and Pointers

Static Member Data

Static Member Functions

Containment of Classes

Friend Classes and Functions

HOUR 21: Using New Features of C++0x

The Next Version of C++

Null Pointer Constant

Compile-Time Constant Expressions

Auto-Typed Variables

New for Loop

HOUR 22: Employing Object-Oriented Analysis and Design

The Development Cycle

Simulating an Alarm System

PostMaster: A Case Study

HOUR 23: Creating Templates

What Are Templates?

Instances of the Template

Template Definition

Using Template Items

HOUR 24: Dealing with Exceptions and Error Handling

Bugs, Errors, Mistakes, and Code Rot

Handling the Unexpected

Exceptions

Using try and catch Blocks

Writing Professional-Quality Code

Part VII: Appendices

APPENDIX A: Binary and Hexadecimal

Other Bases

Around the Bases

Hexadecimal

APPENDIX B: Glossary

APPENDIX C: This Book’s Website

Index

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

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