| Preface |
|
v | |
|
Computers and programming |
|
|
1 | (28) |
|
A computer's structure and operation |
|
|
1 | (4) |
|
How you get the program into the computer |
|
|
5 | (9) |
|
|
|
14 | (5) |
|
The process of developing programs |
|
|
19 | (3) |
|
|
|
22 | (2) |
|
|
|
24 | (5) |
|
|
|
26 | (3) |
|
|
|
29 | (50) |
|
Variables and reading/writing |
|
|
29 | (8) |
|
|
|
37 | (5) |
|
|
|
42 | (3) |
|
Comparison operators and logical operators |
|
|
45 | (3) |
|
|
|
48 | (8) |
|
|
|
56 | (2) |
|
|
|
58 | (7) |
|
Sequences: vector and deque |
|
|
65 | (5) |
|
General characteristics of sequences |
|
|
66 | (2) |
|
Special characteristics of the classes vector and deque |
|
|
68 | (2) |
|
|
|
70 | (9) |
|
|
|
73 | (6) |
|
|
|
79 | (30) |
|
Character codes and character literals |
|
|
79 | (3) |
|
Single characters: reading and writing |
|
|
82 | (3) |
|
The standard class string |
|
|
85 | (13) |
|
|
|
98 | (11) |
|
|
|
108 | (1) |
|
|
|
109 | (38) |
|
Functions that return a value |
|
|
109 | (10) |
|
Functions that do not return a value |
|
|
119 | (3) |
|
Declaration scope and visibility |
|
|
122 | (3) |
|
|
|
125 | (2) |
|
|
|
127 | (4) |
|
|
|
131 | (7) |
|
Parameters with default values |
|
|
138 | (2) |
|
|
|
140 | (7) |
|
|
|
143 | (4) |
|
|
|
147 | (56) |
|
|
|
148 | (6) |
|
Storing integers in a computer |
|
|
148 | (2) |
|
|
|
150 | (4) |
|
|
|
154 | (3) |
|
Storing real numbers in a computer |
|
|
154 | (2) |
|
Predefined floating-point types |
|
|
156 | (1) |
|
|
|
157 | (1) |
|
|
|
157 | (24) |
|
|
|
157 | (1) |
|
|
|
158 | (4) |
|
|
|
162 | (5) |
|
|
|
167 | (4) |
|
|
|
171 | (4) |
|
|
|
175 | (1) |
|
Pointers and references: a comparison |
|
|
176 | (2) |
|
|
|
178 | (3) |
|
Complicated declarations: typedef |
|
|
181 | (2) |
|
|
|
183 | (1) |
|
|
|
184 | (2) |
|
Automatic type conversions |
|
|
184 | (1) |
|
Explicit type conversions |
|
|
185 | (1) |
|
|
|
186 | (5) |
|
|
|
191 | (5) |
|
|
|
191 | (3) |
|
Tables with the help of vectors |
|
|
194 | (2) |
|
|
|
196 | (7) |
|
|
|
199 | (4) |
|
Object-oriented program development |
|
|
203 | (12) |
|
|
|
203 | (2) |
|
|
|
205 | (5) |
|
|
|
210 | (1) |
|
Object-oriented programming |
|
|
211 | (4) |
|
|
|
214 | (1) |
|
|
|
215 | (38) |
|
|
|
215 | (7) |
|
|
|
222 | (5) |
|
|
|
227 | (14) |
|
Declarations of constructors |
|
|
227 | (1) |
|
Definitions of constructors |
|
|
228 | (2) |
|
|
|
230 | (3) |
|
|
|
233 | (5) |
|
Type conversion constructors |
|
|
238 | (3) |
|
|
|
241 | (2) |
|
An object-oriented example |
|
|
243 | (10) |
|
|
|
250 | (3) |
|
|
|
253 | (34) |
|
|
|
253 | (2) |
|
|
|
255 | (1) |
|
|
|
256 | (3) |
|
|
|
259 | (19) |
|
|
|
261 | (5) |
|
Predefined comparison operators |
|
|
266 | (2) |
|
|
|
268 | (2) |
|
|
|
270 | (2) |
|
|
|
272 | (1) |
|
The function call operator |
|
|
273 | (2) |
|
Friend functions as operators |
|
|
275 | (2) |
|
Type conversion operators |
|
|
277 | (1) |
|
|
|
278 | (4) |
|
|
|
282 | (5) |
|
|
|
285 | (2) |
|
|
|
287 | (56) |
|
|
|
287 | (6) |
|
Constructors, destructors and inheritance |
|
|
293 | (5) |
|
|
|
298 | (4) |
|
Reusable code: an example |
|
|
302 | (14) |
|
Polymorphism and dynamic binding |
|
|
316 | (9) |
|
The operators typeid and dynamic_cast |
|
|
325 | (3) |
|
|
|
328 | (2) |
|
|
|
330 | (4) |
|
|
|
334 | (3) |
|
|
|
337 | (6) |
|
|
|
341 | (2) |
|
|
|
343 | (24) |
|
|
|
344 | (3) |
|
|
|
347 | (10) |
|
Defining our own exception classes: an example |
|
|
357 | (4) |
|
Specification of exceptions |
|
|
361 | (6) |
|
|
|
365 | (2) |
|
|
|
367 | (52) |
|
|
|
368 | (5) |
|
|
|
373 | (4) |
|
|
|
373 | (3) |
|
|
|
376 | (1) |
|
|
|
377 | (4) |
|
|
|
377 | (4) |
|
|
|
381 | (1) |
|
Connecting files to streams |
|
|
381 | (9) |
|
File names as arguments to main |
|
|
390 | (4) |
|
|
|
394 | (7) |
|
Storing heterogeneous objects in files |
|
|
401 | (7) |
|
Connecting string objects to streams |
|
|
408 | (3) |
|
Connecting text strings to streams |
|
|
411 | (8) |
|
|
|
415 | (4) |
|
Container classes and algorithms |
|
|
419 | (50) |
|
|
|
420 | (8) |
|
Running through containers with iterators |
|
|
421 | (5) |
|
Operations with iterators as parameters |
|
|
426 | (1) |
|
|
|
427 | (1) |
|
Algorithms: general characteristics |
|
|
428 | (3) |
|
|
|
431 | (13) |
|
Using pointers to functions |
|
|
432 | (4) |
|
Using real function objects |
|
|
436 | (3) |
|
Using predefined function objects |
|
|
439 | (5) |
|
|
|
444 | (4) |
|
|
|
448 | (15) |
|
The standard classes map and multimap |
|
|
450 | (7) |
|
The standard classes set and multiset |
|
|
457 | (6) |
|
|
|
463 | (6) |
|
|
|
468 | (1) |
|
|
|
469 | (42) |
|
|
|
469 | (10) |
|
|
|
469 | (6) |
|
|
|
475 | (4) |
|
Linked lists: applications |
|
|
479 | (12) |
|
|
|
479 | (3) |
|
|
|
482 | (3) |
|
|
|
485 | (6) |
|
Iterators: implementations |
|
|
491 | (5) |
|
|
|
496 | (15) |
|
|
|
497 | (5) |
|
|
|
502 | (2) |
|
|
|
504 | (4) |
|
|
|
508 | (3) |
|
|
|
511 | (48) |
|
|
|
512 | (22) |
|
|
|
512 | (5) |
|
|
|
517 | (2) |
|
|
|
519 | (1) |
|
|
|
520 | (2) |
|
|
|
522 | (5) |
|
|
|
527 | (7) |
|
|
|
534 | (9) |
|
Definitions and instances |
|
|
534 | (4) |
|
Generic standard functions: the algorithm library |
|
|
538 | (5) |
|
Heterogeneous object collections |
|
|
543 | (16) |
|
|
|
544 | (2) |
|
The combination of inheritances and templates |
|
|
546 | (2) |
|
|
|
548 | (9) |
|
|
|
557 | (2) |
|
The final pieces of the puzzle |
|
|
559 | (22) |
|
|
|
559 | (7) |
|
Definition of name spaces |
|
|
560 | (3) |
|
|
|
563 | (2) |
|
Name spaces and standard libraries |
|
|
565 | (1) |
|
|
|
566 | (1) |
|
|
|
567 | (2) |
|
|
|
569 | (4) |
|
|
|
573 | (2) |
|
|
|
575 | (1) |
|
|
|
576 | (2) |
|
|
|
578 | (3) |
|
|
|
579 | (2) |
| Appendix A Reserved words and operators |
|
581 | (2) |
| Appendix B LATIN_1 codes |
|
583 | (2) |
| Appendix C Standard algorithms |
|
585 | (34) |
|
|
|
585 | (6) |
|
C.2 Compare, run through, count |
|
|
591 | (2) |
|
C.3 Copy and move elements |
|
|
593 | (5) |
|
C.4 Change and delete elements |
|
|
598 | (4) |
|
|
|
602 | (2) |
|
|
|
604 | (3) |
|
C.7 Operations on sorted containers |
|
|
607 | (4) |
|
|
|
611 | (1) |
|
|
|
612 | (3) |
|
|
|
615 | (4) |
| Index |
|
619 | |