| Preface |
|
V | |
|
Chapter 1--C++ as Structured Programming: An Historical Perspective |
|
|
1 | (12) |
|
|
|
1 | (1) |
|
1.1 Structured Programming |
|
|
2 | (5) |
|
History of Pascal as Structured Programming |
|
|
3 | (1) |
|
|
|
3 | (1) |
|
|
|
4 | (1) |
|
Other Characteristics of Structured Programming |
|
|
5 | (2) |
|
Concluding Remarks on Structured Programming |
|
|
7 | (1) |
|
1.2 Algorithms + Data Structures = Objects |
|
|
7 | (4) |
|
Classes and Objects for the Pascal Programmer |
|
|
8 | (1) |
|
|
|
9 | (1) |
|
The Power of Classes and Objects |
|
|
9 | (1) |
|
Concluding Remarks on Classes and Objects |
|
|
10 | (1) |
|
1.3 Programming Paradigms |
|
|
11 | (1) |
|
|
|
11 | (1) |
|
|
|
12 | (1) |
|
Chapter 2--The C++ Subset That Covers Pascal |
|
|
13 | (70) |
|
|
|
13 | (2) |
|
|
|
15 | (5) |
|
|
|
16 | (1) |
|
|
|
17 | (1) |
|
|
|
17 | (1) |
|
|
|
18 | (1) |
|
|
|
18 | (2) |
|
2.2 Data Types and Data Structures |
|
|
20 | (10) |
|
|
|
20 | (1) |
|
|
|
21 | (1) |
|
|
|
22 | (1) |
|
|
|
23 | (1) |
|
|
|
24 | (6) |
|
2.3 Arithmetic, Boolean, and Logical Expressions |
|
|
30 | (4) |
|
|
|
31 | (1) |
|
|
|
31 | (1) |
|
Data Conversion with Assignment |
|
|
31 | (1) |
|
|
|
31 | (2) |
|
Relational and Logical Operators |
|
|
33 | (1) |
|
Precedence in Relational Expressions |
|
|
34 | (1) |
|
|
|
34 | (6) |
|
The if and if...else Statements |
|
|
35 | (1) |
|
|
|
36 | (1) |
|
|
|
37 | (1) |
|
|
|
38 | (1) |
|
|
|
38 | (1) |
|
|
|
39 | (1) |
|
|
|
40 | (15) |
|
|
|
40 | (1) |
|
|
|
41 | (1) |
|
|
|
42 | (1) |
|
|
|
42 | (1) |
|
|
|
43 | (1) |
|
|
|
44 | (3) |
|
|
|
47 | (2) |
|
|
|
49 | (3) |
|
|
|
52 | (2) |
|
|
|
54 | (1) |
|
2.6 Dynamically Allocated Structures |
|
|
55 | (6) |
|
|
|
56 | (1) |
|
|
|
57 | (1) |
|
|
|
58 | (1) |
|
Manipulating Dynamic Structures |
|
|
58 | (1) |
|
|
|
59 | (1) |
|
Data Structure as Arguments |
|
|
59 | (2) |
|
|
|
61 | (7) |
|
|
|
62 | (3) |
|
|
|
65 | (3) |
|
|
|
68 | (1) |
|
|
|
68 | (13) |
|
Index of C++ Symbols, Keywords, Operators, and Library Functions Forming "the Pascal Subset" |
|
|
69 | (12) |
|
|
|
81 | (2) |
|
Chapter 3--Procedural C++ That Extends Pascal |
|
|
83 | (44) |
|
|
|
83 | (1) |
|
|
|
83 | (11) |
|
|
|
84 | (1) |
|
The Compound Assignment Operators |
|
|
84 | (1) |
|
The Unary Increment and Decrement Operators |
|
|
85 | (2) |
|
The Conditional Expression Operator,?: |
|
|
87 | (1) |
|
|
|
88 | (2) |
|
|
|
90 | (1) |
|
The address-of Operator and the Indirection Operator |
|
|
90 | (4) |
|
|
|
94 | (21) |
|
Understanding and Managing Arrays |
|
|
96 | (8) |
|
|
|
104 | (7) |
|
Dynamically Allocated Arrays |
|
|
111 | (4) |
|
|
|
115 | (8) |
|
Function-Name Overloading |
|
|
115 | (3) |
|
Default Values for Trailing Arguments |
|
|
118 | (4) |
|
Static Variables Within Functions |
|
|
122 | (1) |
|
|
|
123 | (3) |
|
|
|
126 | (1) |
|
Chapter 4--C++ and Object-Oriented Programming |
|
|
127 | (126) |
|
|
|
127 | (1) |
|
|
|
128 | (18) |
|
|
|
132 | (1) |
|
|
|
132 | (1) |
|
|
|
133 | (1) |
|
|
|
134 | (3) |
|
|
|
137 | (1) |
|
Overloading Member Functions |
|
|
138 | (2) |
|
Free Functions That Have Box Arguments and Return Boxes |
|
|
140 | (2) |
|
|
|
142 | (4) |
|
Concluding Remark on Classes and Objects in C++ |
|
|
146 | (1) |
|
4.2 Constructors and Destructors |
|
|
146 | (27) |
|
|
|
148 | (1) |
|
An Example with Constructors |
|
|
148 | (11) |
|
|
|
159 | (4) |
|
Static Data and Functions |
|
|
163 | (6) |
|
|
|
169 | (4) |
|
4.3 Manipulating Abstractions: Friends and Operator Overloading |
|
|
173 | (43) |
|
|
|
173 | (2) |
|
Friend Function and Friend Classes |
|
|
175 | (7) |
|
|
|
182 | (34) |
|
4.4 Relationships Among Classes: Composition and Derivation |
|
|
216 | (36) |
|
|
|
216 | (3) |
|
|
|
219 | (3) |
|
|
|
222 | (11) |
|
|
|
233 | (8) |
|
|
|
241 | (11) |
|
|
|
252 | (1) |
|
|
|
253 | (306) |
|
|
|
253 | (1) |
|
|
|
254 | (9) |
|
Motivating Function Templates |
|
|
255 | (1) |
|
Defining Function Templates |
|
|
256 | (7) |
|
|
|
263 | (51) |
|
A container Built From Two Scalars |
|
|
265 | (22) |
|
A Container Built From an Array |
|
|
287 | (7) |
|
A Container Built From a Linked Storage Structure |
|
|
294 | (20) |
|
|
|
314 | (1) |
|
|
|
315 | (142) |
|
|
|
315 | (3) |
|
|
|
318 | (28) |
|
|
|
346 | (27) |
|
|
|
373 | (41) |
|
|
|
414 | (43) |
|
Answers to Odd-Numbered Exercises |
|
|
457 | (102) |
|
|
|
457 | (1) |
|
|
|
458 | (9) |
|
|
|
467 | (5) |
|
|
|
472 | (70) |
|
|
|
542 | (17) |
| Index |
|
559 | |