| |
| |
Preface | |
| |
| |
| |
Introduction | |
| |
| |
| |
About C++ and Other Languages | |
| |
| |
| |
An Unrealistic Program | |
| |
| |
| |
Memory Organization and Binary Numbers | |
| |
| |
| |
Identifiers and Keywords | |
| |
| |
| |
Literals | |
| |
| |
| |
The Standard Type string | |
| |
| |
| |
Some Elements of STL | |
| |
| |
| |
Comments | |
| |
| |
Exercises | |
| |
| |
| |
Expressions and Statements | |
| |
| |
| |
Arithmetic Operations | |
| |
| |
| |
Types, Variables, and Assignments | |
| |
| |
| |
Comparison and Logical Operators | |
| |
| |
| |
Compound Statements and If-statements | |
| |
| |
| |
Iteration Statements | |
| |
| |
| |
Break, Continue, Goto, Switch | |
| |
| |
| |
Simple Declarations | |
| |
| |
Exercises | |
| |
| |
| |
More Operators | |
| |
| |
| |
Conditional Expressions | |
| |
| |
| |
The Comma Operator | |
| |
| |
| |
Bit Manipulation | |
| |
| |
| |
Simple Arrays | |
| |
| |
| |
Associativity | |
| |
| |
| |
Precedence of Operators and Grammar Rules | |
| |
| |
| |
Arithmetic Conversions and Casts | |
| |
| |
| |
Lvalues and Rvalues | |
| |
| |
Exercises | |
| |
| |
| |
Functions and Program Structure | |
| |
| |
| |
Function Definitions and Declarations; Recursion | |
| |
| |
| |
Keyword void, Global Variables, Namespaces | |
| |
| |
| |
Altering Variables via Parameters | |
| |
| |
| |
Types of Arguments and Return Values | |
| |
| |
| |
More about Initialization | |
| |
| |
| |
Separate Compilation and Unnamed Namespaces | |
| |
| |
| |
Some Mathematical Standard Functions | |
| |
| |
| |
Function Overloading | |
| |
| |
| |
References as Return Values | |
| |
| |
| |
Reference Parameters and const | |
| |
| |
| |
Inline Functions | |
| |
| |
| |
Some Preprocessor Facilities | |
| |
| |
Exercises | |
| |
| |
| |
Arrays, Pointers, and Strings | |
| |
| |
| |
Address Arithmetic | |
| |
| |
| |
Function Arguments and Arrays | |
| |
| |
| |
Pointers | |
| |
| |
| |
C-style Strings and the Standard string Type | |
| |
| |
| |
String Constructors and String Assignment | |
| |
| |
| |
C-style Strings and Conversion | |
| |
| |
| |
Type string: Length, Copy, and Compare | |
| |
| |
| |
Type string: Append, Insert, and Concatenate | |
| |
| |
| |
Type string: Search, Substring, and Swap | |
| |
| |
| |
Type string: Input and Output | |
| |
| |
| |
Multi-dimensional Arrays | |
| |
| |
| |
Arrays of Pointers and Pointers to Arrays | |
| |
| |
| |
Program Parameters | |
| |
| |
| |
In-memory Format Conversion | |
| |
| |
| |
Pointers to Functions | |
| |
| |
| |
Dynamic Memory Allocation | |
| |
| |
Exercises | |
| |
| |
| |
Classes and Objects | |
| |
| |
| |
The Word struct | |
| |
| |
| |
A Constructor and Other Member Functions | |
| |
| |
| |
Constructor Initializers | |
| |
| |
| |
Member Functions Defined Outside a Class | |
| |
| |
| |
More about Constructors | |
| |
| |
| |
Operator Overloading and Friend Functions | |
| |
| |
| |
Operators, Conversion, and the Word explicit | |
| |
| |
| |
Destructor and Default Constructor | |
| |
| |
| |
Copying a Class Object | |
| |
| |
| |
Inheritance | |
| |
| |
| |
Virtual Functions | |
| |
| |
| |
Run-time Type Information and dynamic_cast | |
| |
| |
| |
Static Class Members | |
| |
| |
| |
Pointers to Class Members | |
| |
| |
| |
Unions and Bit Fields | |
| |
| |
| |
Function Objects | |
| |
| |
Exercises | |
| |
| |
| |
Templates | |
| |
| |
| |
Introduction | |
| |
| |
| |
Function Templates | |
| |
| |
| |
Class Templates | |
| |
| |
| |
Type string Revisited | |
| |
| |
| |
Complex Numbers | |
| |
| |
Exercises | |
| |
| |
| |
Exception Handling | |
| |
| |
| |
Errors and Exceptions | |
| |
| |
| |
Using the Keywords try, catch, and throw | |
| |
| |
| |
Exception Classes | |
| |
| |
| |
Error Handling with new | |
| |
| |
| |
Exception Specifications | |
| |
| |
Exercises | |
| |
| |
| |
Introduction to STL | |
| |
| |
| |
Access to Vectors via Iterators | |
| |
| |
| |
Vectors, Lists, Deques; Container Adaptors | |
| |
| |
| |
Iterator Categories | |
| |
| |
| |
Arrays and STL Algorithms | |
| |
| |
| |
Special Member Functions for Lists | |
| |
| |
| |
Introduction to Associative Containers | |
| |
| |
| |
Sets and Multisets | |
| |
| |
| |
Maps and Multimaps | |
| |
| |
| |
Pairs and Comparisons | |
| |
| |
| |
Function Objects and Function Adaptors | |
| |
| |
| |
Nonmodifying Sequence Algorithms | |
| |
| |
| |
Modifying Sequence Algorithms | |
| |
| |
| |
Sorting-related Algorithms | |
| |
| |
| |
Generalized Numeric Algorithms | |
| |
| |
| |
Bit Sequences: bitset | |
| |
| |
Exercises | |
| |
| |
| |
Stream I/O | |
| |
| |
| |
Streams | |
| |
| |
| |
Output | |
| |
| |
| |
Input | |
| |
| |
| |
File I/O | |
| |
| |
| |
Random Access | |
| |
| |
| |
Error States | |
| |
| |
| |
In-memory Format Conversion Revisited | |
| |
| |
Exercises | |
| |
| |
| |
Some Older Library Functions | |
| |
| |
| |
Diagnostics: [cassert] | |
| |
| |
| |
Character Classification: [cctype] | |
| |
| |
| |
Error Numbers: [cerrno] | |
| |
| |
| |
Floating-point Precision: [cfloat] | |
| |
| |
| |
Maximum Integer, etc.: [climits] | |
| |
| |
| |
Mathematical Functions: [cmath] | |
| |
| |
| |
Variable-length Argument Lists: [cstdarg] | |
| |
| |
| |
Input and Output: [cstdio] | |
| |
| |
| |
Miscellaneous: [cstdlib] | |
| |
| |
| |
C-style String Functions: [cstring] | |
| |
| |
| |
Time and Date: [ctime] | |
| |
| |
Exercises | |
| |
| |
| |
More about Manipulators | |
| |
| |
| |
Table of ASCII Values | |
| |
| |
| |
Answers to Exercises | |
| |
| |
Bibliography | |
| |
| |
Index | |