Introduction
A brief discussion of the book's
background and contents.
The basics
The form of a simple C++ program
is explained. Comments, names, the fundamental types, constants and simple
input and output are discussed.
Variables and Expressions
Variables, operators and
expressions are explained in this chapter. All the important C++ operators
are discussed. How to use the standard C++ string class is explained. Type
conversion and side effects are also discussed.
Controlling Execution
The control statements available
in C++ are described. These include if,
switch,
while,
do
and for
statements.
Compound Types
The use of structures and arrays
is explained. Pointers and memory management are introduced. Other material
covered in this chapter includes typedef
names, reference types, and old C style strings.
Functions
Functions and their use are
explained. The different sorts of parameters and return values that can be
used with function are described. Recursive functions are discussed.
Classes
This introduces the concept of
classes and shows how class objects can be used to build programs.
Constructors and destructors are explained.
More about Classes
This chapter introduces more
material on classes. Inline member functions, static members, constant
objects and members, nested classes and separate compilation are amongst the
C++ class features discussed.
Friends and Operators
Friend functions and classes are
explained, and operator overloading is introduced.
Inheritance
This extends the previous
chapters by showing how inheritance can be used to build class hierarchies.
Single and multiple inheritance and some aspects of C++ design style are
discussed.
Virtual Functions
Some of the more advanced
aspects of C++ programming are considered in this chapter. The concept of
polymorphism is introduced. Virtual functions and pointers to objects are
presented as one method of supporting polymorphism in C++.
Templates
This chapter introduces
templates as an important feature of C++. Function templates are explained.
Generic and container classes are discussed, and C++ class templates are
introduced to support these concepts.
Advanced Features
This final chapter introduces
some of the newer features of C++. Exception handling, casting, run-time
type information and name spaces are all discussed. In particular, casting
is explained in detail because of the dangers associated with the use of
this feature.
More Input and Output
The use of the standard C++
input and output streams has already been introduced, but this chapter
provides much more detail. Topics that are discussed include the standard
streams, setting flags and parameters, named files, and how to detect and
manage stream errors and end of file conditions.
Appendices
Model solutions
The appendices include worked
solutions for almost all the chapter exercises.
C++ strings
A detailed description of the
most of the features in the proposed standard C++ string class.
C++ keywords and
operators
A list of C++ keywords and a
tabulated summary of C++ operators showing their precedence and
associativity.
Arithmetic conversions
A description of the automatic
conversions used by C++ during arithmetic calculations.
C Library Functions
A list of some useful C
libraries. These are superceded by the Draft Standard, but the equivalent
functions will most likely be available.