The Table of Contents for On To C++ follows.
Additional information about this book, along with access to software, is
available via http://www.ai.mit.edu/people/phw/Books/
Contents
In this Table of Contents, you learn about what On To C++ contains
in detail.
1 How this Book Teaches You the Language
- Why you should learn C++
- Object-oriented programming languages
- Procedure-oriented programing languages
- Programming cliches
2 How To Compile and Run a Simple Program
- Compiling, linking, and executing
- Statements and declarations
- The output operator, <<, and character strings
- Case sensitivity and blank insensitivity
- Operators and operands
3 How To Declare Variables
- Data types and variable declarations
- Initialization and assignment
- Integral data types
4 How To Write Arithmetic Expressions
- Arithmetic
- Precedence and association
- Binary and unary operators
- Type casting
5 How To Write Statements that Read Information from your Keyboard
- The input operator, >>
- Input redirection
6 How To Define Simple Functions
- Calling and returning from functions
- Arguments, parameters, and values
- Function overloading
7 How To Benefit from Procedure Abstraction
- Making programs easier to reuse, read, and debug
- Making programs easier to augment, improve, and adapt
8 How To Work with Local and Global Variables
- Extent and scope
- Local, static, and global variables
- Compound statements
9 How To Create Classes and Objects
- User-defined data types, classes, and objects
- Class specification and member variables
- The class-member operator
10 How To Define Member Functions
- The special, class-object argument
- Member function prototypes
- The class-scope operator, ::
11 How To Define Constructor Member Functions
- The default constructor
- Argument-bearing constructors
12 How To Define Reader and Writer Member Functions
- Reader and writer member functions
- Imaginary member variables
13 How To Benefit from Data Abstraction
- Access functions and data abstraction
- Making programs easier to reuse
14 How To Protect Member Variables from Harmful Reference
- Private member variables and member functions
- The public interface
15 How To Define Classes that Inherit Variables and Functions
- Inheriting member variables and member functions
- Derived classes and base classes
- Multiple inheritance and shadowing
16 How To Design Classes and Class Hierarchies
- Explicit representation
- Reusing functions and avoiding duplication
- The local-view and the look-it-up principles
- The need-to-know and the keep-it-simple principles
17 How To Perform Tests Using Numerical Predicates
- Equal, ==, and not equal, !=
- Greater than, >, and less than, <
- Not, !
18 How To Write One-Way and Two-Way Conditional Statements
- Boolean expressions
- if and if else
- Empty and compound statements
- The conditional operator, ?:
19 How To Combine Boolean Expressions
- And, &&, and or, ||
- Evaluation order
20 How To Write Iteration Statements
- while and for statements
- Augmented assignment operators
- Increment, ++, and decrement, --, operators
- Side effects and evaluation order
21 How To Process Data in Files
- while reading and for reading loops
- Action of the input operator at the end of a file
22 How To Write Recursive Functions
- Functions that call themselves
- The base part and the recursion part
- Efficiency considerations
23 How To Solve Definition Ordering Problems with Function Prototypes
- The definition-before-call requirement
- Declare now, define later
24 How To Work with Arrays Of Numbers
- Arrays of numeric elements
- Filling a numeric array from a file
25 How To Work with Arrays of Class Objects
- Arrays of class-object elements
- Filling an object array from a file
26 How To Create File Streams for Input and Output
- Creating streams
- Opening and closing files for reading and writing
- ifstream and ofstream statements
27 How To Create New Class Objects at Run Time
- Pointers and the free store
- Allocating space with new
- The dereferencing operator, *
- The class-pointer operator, ->
- The address-of operator, &
28 How To Store Pointers to Class Objects
- Wasting space by defining too-large object arrays
- Saving space by defining too-large pointer arrays
29 How To Write Programs that Find Member Functions at Run Time
- Arrays of pointers to miscellaneous objects
- Virtual member functions
- Pure virtual functions
30 How To Write Multiway Conditional Statements
- switch statements
- The cerr output stream
- exit statements
31 How To Use Enumerations to Improve Readability
- The mnemonic sterility of numbers
- The enumeration data type
- The integral data types
- The character data type
32 How To Write Constructors that Call other Constructors
33 How To Write Member Functions that Call other Member Functions
34 How To Use Protected and Private Variables and Functions
35 How To Use Protected and Private Class Derivations
36 How To Write Functions that Return Character Strings
- Character strings and character arrays
- The null character, \O
37 How To Use Call-by-Reference Parameters
- Call by value and incomplete argument copying
- Using call by reference to access entire objects
- Using call by reference to save time
- Using call by reference to alter arguments
38 How To Overload the Output Operator
- Copy-free function return
- Pass-through objects
- Operator overloading
39 How To Produce Tabular Displays
- The printf function}
- Field widths and padding characters
- Printing strings, characters, and numbers
40 How To Write Statements that Read Character Strings from Files
- Input buffers
- Using the input operator with a character pointer
- Array names viewed as constant pointers
41 How To Test String Characters
- Characters viewed as integers
- Obtaining character codes
- Using enumeration constants as character codes
42 How To Deposit Character Strings into Class Objects
- Creating character arrays at run time using new
- Using strlen and strcpy to measure and copy
43 How To Reclaim Memory with Delete and Destructors
- Garbage and memory leaks
- delete viewed as the complement of new
- Destructor member functions
- Static member variables
44 How To Prevent Object Copying
- The excess-reclamation bug
- Defining your own copy constructor
45 How To Organize a Multiple-File Program
- Header files
- Separating class and member-function definitions
- Inline functions
- Managing global variables with static and extern
46 How To Compile a Multiple-File Program
- Recording file dependencies in a makefile
- Maintaining systems using the make utility
47 How To Implement Lists
- Using lists to conserve memory
- Internal and external pointers
- The null pointer, NULL
48 How To Make one Class a Friend of Another Class
49 How To Reuse Class Definitions Using Templates
50 How To Iterate over Lists using Iteration Class Objects
Appendix A: Operator Precedence
Appendix B: Formatted Display
Colophon
Index