| Preface |
|
xi | |
|
|
|
1 | (8) |
|
|
|
1 | (1) |
|
|
|
2 | (1) |
|
|
|
2 | (1) |
|
|
|
2 | (1) |
|
Using the standard library for output |
|
|
3 | (1) |
|
|
|
3 | (1) |
|
|
|
4 | (1) |
|
|
|
5 | (4) |
|
|
|
9 | (8) |
|
|
|
9 | (2) |
|
|
|
11 | (3) |
|
|
|
14 | (3) |
|
|
|
17 | (18) |
|
|
|
17 | (1) |
|
|
|
18 | (1) |
|
Writing an unknown number of rows |
|
|
18 | (4) |
|
|
|
22 | (5) |
|
The complete framing program |
|
|
27 | (3) |
|
|
|
30 | (1) |
|
|
|
31 | (4) |
|
Working with batches of data |
|
|
35 | (16) |
|
|
|
35 | (6) |
|
Using medians instead of averages |
|
|
41 | (7) |
|
|
|
48 | (3) |
|
Organizing programs and data |
|
|
51 | (24) |
|
|
|
51 | (10) |
|
|
|
61 | (5) |
|
|
|
66 | (2) |
|
Partitioning the grading program |
|
|
68 | (2) |
|
The revised grading program |
|
|
70 | (1) |
|
|
|
71 | (4) |
|
Using sequential containers and analyzing strings |
|
|
75 | (26) |
|
Separating students into categories |
|
|
75 | (4) |
|
|
|
79 | (3) |
|
Using iterators instead of indices |
|
|
82 | (2) |
|
Rethinking our data structure for better performance |
|
|
84 | (1) |
|
|
|
85 | (2) |
|
|
|
87 | (3) |
|
Testing our split function |
|
|
90 | (1) |
|
|
|
91 | (5) |
|
|
|
96 | (5) |
|
|
|
101 | (22) |
|
|
|
101 | (9) |
|
Comparing grading schemes |
|
|
110 | (6) |
|
Classifying students, revisited |
|
|
116 | (4) |
|
Algorithms, containers, and iterators |
|
|
120 | (1) |
|
|
|
121 | (2) |
|
Using associative containers |
|
|
123 | (16) |
|
Containers that support efficient look-up |
|
|
123 | (1) |
|
|
|
124 | (2) |
|
Generating a cross-reference table |
|
|
126 | (3) |
|
|
|
129 | (7) |
|
|
|
136 | (1) |
|
|
|
137 | (2) |
|
Writing generic functions |
|
|
139 | (16) |
|
What is a generic function? |
|
|
139 | (4) |
|
Data-structure independence |
|
|
143 | (7) |
|
Input and output iterators |
|
|
150 | (2) |
|
Using iterators for flexibility |
|
|
152 | (1) |
|
|
|
153 | (2) |
|
|
|
155 | (14) |
|
|
|
155 | (1) |
|
|
|
156 | (4) |
|
|
|
160 | (3) |
|
|
|
163 | (1) |
|
|
|
164 | (2) |
|
Using the Student__info class |
|
|
166 | (1) |
|
|
|
167 | (2) |
|
Managing memory and low-level data structures |
|
|
169 | (18) |
|
|
|
169 | (7) |
|
String literals revisited |
|
|
176 | (1) |
|
Initializing arrays of character pointers |
|
|
177 | (2) |
|
|
|
179 | (1) |
|
Reading and writing files |
|
|
180 | (2) |
|
Three kinds of memory management |
|
|
182 | (3) |
|
|
|
185 | (2) |
|
Defining abstract data types |
|
|
187 | (24) |
|
|
|
187 | (1) |
|
Implementing the Vec class |
|
|
188 | (7) |
|
|
|
195 | (7) |
|
|
|
202 | (1) |
|
Flexible memory management |
|
|
203 | (6) |
|
|
|
209 | (2) |
|
Making class objects act like values |
|
|
211 | (16) |
|
|
|
212 | (1) |
|
|
|
213 | (1) |
|
|
|
214 | (7) |
|
Some conversions are hazardous |
|
|
221 | (1) |
|
|
|
222 | (1) |
|
Conversions and memory management |
|
|
223 | (2) |
|
|
|
225 | (2) |
|
Using inheritance and dynamic binding |
|
|
227 | (26) |
|
|
|
227 | (5) |
|
Polymorphism and virtual functions |
|
|
232 | (5) |
|
Using inheritance to solve our problem |
|
|
237 | (6) |
|
|
|
243 | (4) |
|
|
|
247 | (1) |
|
|
|
248 | (2) |
|
|
|
250 | (3) |
|
Managing memory (almost) automatically |
|
|
253 | (16) |
|
Handles that copy their objects |
|
|
254 | (5) |
|
Reference-counted handles |
|
|
259 | (4) |
|
Handles that let you decide when to share data |
|
|
263 | (1) |
|
An improvement on controllable handles |
|
|
264 | (4) |
|
|
|
268 | (1) |
|
Revisiting character pictures |
|
|
269 | (22) |
|
|
|
269 | (9) |
|
|
|
278 | (10) |
|
|
|
288 | (3) |
|
Where do we go from here? |
|
|
291 | (4) |
|
Use the abstractions you have |
|
|
291 | (2) |
|
|
|
293 | (2) |
| Appendix A Language details |
|
295 | (16) |
|
|
|
295 | (4) |
|
|
|
299 | (6) |
|
|
|
305 | (3) |
|
|
|
308 | (3) |
| Appendix B Library summary |
|
311 | (14) |
|
|
|
311 | (3) |
|
B.2 Containers and iterators |
|
|
314 | (7) |
|
|
|
321 | (4) |
| Index |
|
325 | |