|
Introduction to Computers and C++ Programming |
|
|
1 | (34) |
|
|
|
3 | (9) |
|
|
|
3 | (4) |
|
|
|
7 | (1) |
|
|
|
8 | (1) |
|
|
|
9 | (2) |
|
|
|
11 | (1) |
|
Programming and Problem-Solving |
|
|
12 | (6) |
|
|
|
13 | (1) |
|
|
|
14 | (1) |
|
Object-Oriented Programming |
|
|
15 | (2) |
|
|
|
17 | (1) |
|
|
|
18 | (10) |
|
Origins of the C++ Language |
|
|
18 | (1) |
|
|
|
19 | (3) |
|
Pitfall: Using the Wrong Slash in \n |
|
|
22 | (1) |
|
Programming Tip: Input and Output Syntax |
|
|
22 | (1) |
|
Layout of a Simple C++ Program |
|
|
23 | (2) |
|
Pitfall: Putting a Space before the include File Name |
|
|
25 | (1) |
|
Compiling and Running a C++ Program |
|
|
25 | (1) |
|
Programming Tip: Getting Your Program to Run |
|
|
26 | (2) |
|
|
|
28 | (7) |
|
|
|
28 | (1) |
|
Pitfall: Assuming Your Program Is Correct |
|
|
29 | (1) |
|
|
|
30 | (1) |
|
Answers to Self-Test Exercises |
|
|
31 | (2) |
|
|
|
33 | (2) |
|
|
|
35 | (62) |
|
Variables and Assignments |
|
|
37 | (9) |
|
|
|
37 | (1) |
|
|
|
38 | (2) |
|
|
|
40 | (1) |
|
|
|
41 | (2) |
|
Pitfall: Uninitialized Variables |
|
|
43 | (2) |
|
Programming Tip: Use Meaningful Names |
|
|
45 | (1) |
|
|
|
46 | (9) |
|
|
|
46 | (1) |
|
Include Directives and Namespaces |
|
|
47 | (2) |
|
|
|
49 | (1) |
|
Programming Tip: End Each Program with a \n or end1 |
|
|
50 | (1) |
|
Formatting for Numbers with a Decimal Point |
|
|
50 | (1) |
|
|
|
51 | (2) |
|
Designing Input and Output |
|
|
53 | (1) |
|
Programming Tip: Line Breaks in I/O |
|
|
53 | (2) |
|
Data Types and Expressions |
|
|
55 | (10) |
|
|
|
55 | (1) |
|
|
|
56 | (2) |
|
|
|
58 | (1) |
|
|
|
58 | (1) |
|
|
|
59 | (2) |
|
Arithmetic Operators and Expressions |
|
|
61 | (2) |
|
Pitfall: Whole Numbers in Division |
|
|
63 | (2) |
|
More Assignment Statements |
|
|
65 | (1) |
|
|
|
65 | (18) |
|
A Simple Branching Mechanism |
|
|
66 | (5) |
|
Pitfall: Strings of Inequalities |
|
|
71 | (1) |
|
Pitfall: Using = in place of == |
|
|
71 | (1) |
|
|
|
72 | (2) |
|
|
|
74 | (3) |
|
Increment and Decrement Operators |
|
|
77 | (2) |
|
Programming Example: Charge Card Balance |
|
|
79 | (1) |
|
|
|
80 | (3) |
|
|
|
83 | (14) |
|
|
|
84 | (1) |
|
|
|
84 | (1) |
|
|
|
85 | (3) |
|
|
|
88 | (1) |
|
Answers to Self-Test Exercises |
|
|
89 | (5) |
|
|
|
94 | (3) |
|
Procedural Abstraction and Functions That Return a Value |
|
|
97 | (58) |
|
|
|
99 | (1) |
|
|
|
99 | (8) |
|
Using Predefined Functions |
|
|
99 | (5) |
|
|
|
104 | (1) |
|
Older Form of Type Casting |
|
|
105 | (1) |
|
Pitfall: Integer Division Drops the Fractional Part |
|
|
106 | (1) |
|
Programmer-Defined Functions |
|
|
107 | (10) |
|
|
|
107 | (4) |
|
Alternate Form for Function Declarations |
|
|
111 | (3) |
|
Pitfall: Arguments in the Wrong Order |
|
|
114 | (1) |
|
Function Definition-Syntax Summary |
|
|
114 | (2) |
|
More About Placement of Function Definitions |
|
|
116 | (1) |
|
|
|
117 | (11) |
|
|
|
117 | (3) |
|
Programming Tip: Choosing Formal Parameter Names |
|
|
120 | (1) |
|
|
|
120 | (7) |
|
Programming Tip: Use Pseudocode |
|
|
127 | (1) |
|
|
|
128 | (12) |
|
The Small Program Analogy |
|
|
128 | (2) |
|
Programming Example: Experimental Pea Patch |
|
|
130 | (1) |
|
Global Constants and Global Variables |
|
|
131 | (2) |
|
Call-by-Value Formal Parameters Are Local Variables |
|
|
133 | (1) |
|
|
|
134 | (4) |
|
Programming Example: The Factorial Function |
|
|
138 | (2) |
|
Overloading Function Names |
|
|
140 | (15) |
|
Introduction to Overloading |
|
|
140 | (3) |
|
Programming Example: Revised Pizza-Buying Program |
|
|
143 | (3) |
|
Automatic Type Conversion |
|
|
146 | (2) |
|
|
|
148 | (1) |
|
Answers to Self-Test Exercises |
|
|
149 | (3) |
|
|
|
152 | (3) |
|
Functions for All Subtasks |
|
|
155 | (44) |
|
|
|
157 | (7) |
|
Definitions of void Functions |
|
|
157 | (2) |
|
Programming Example: Converting Temperatures |
|
|
159 | (1) |
|
return Statements in void Functions |
|
|
159 | (5) |
|
Call-by-Reference Parameters |
|
|
164 | (12) |
|
A First View of Call-by-Reference |
|
|
164 | (1) |
|
Call-by-Reference in Detail |
|
|
165 | (5) |
|
Programming Example: The swap_values Function |
|
|
170 | (2) |
|
|
|
172 | (1) |
|
Programming Tip: What Kind of Parameter to Use |
|
|
172 | (2) |
|
Pitfall: Inadvertent Local Variables |
|
|
174 | (2) |
|
Using Procedural Abstraction |
|
|
176 | (10) |
|
Functions Calling Functions |
|
|
176 | (1) |
|
Preconditions and Postconditions |
|
|
177 | (3) |
|
Case Study: Supermarket Pricing |
|
|
180 | (6) |
|
Testing and Debugging Functions |
|
|
186 | (13) |
|
|
|
186 | (5) |
|
|
|
191 | (1) |
|
Answers to Self-Test Exercises |
|
|
192 | (3) |
|
|
|
195 | (4) |
|
I/O Streams as an Introduction to Objects and Classes |
|
|
199 | (70) |
|
Streams and Basic File I/O |
|
|
201 | (15) |
|
|
|
201 | (1) |
|
|
|
202 | (4) |
|
Introduction to Classes and Objects |
|
|
206 | (2) |
|
Programming Tip: Check Whether a File Was Opened Successfully |
|
|
208 | (1) |
|
|
|
209 | (4) |
|
Appending to a File (Optional) |
|
|
213 | (1) |
|
File Names as Input (Optional) |
|
|
213 | (3) |
|
|
|
216 | (15) |
|
Formatting Output with Stream Functions |
|
|
216 | (5) |
|
|
|
221 | (4) |
|
Streams as Arguments to Functions |
|
|
225 | (1) |
|
Programming Tip: Checking for the End of a File |
|
|
225 | (4) |
|
|
|
229 | (1) |
|
Programming Example: Cleaning Up a File Format |
|
|
230 | (1) |
|
|
|
231 | (18) |
|
The Member Functions get and put |
|
|
231 | (4) |
|
The putback Member Function (Optional) |
|
|
235 | (1) |
|
Programming Example: Checking Input |
|
|
235 | (3) |
|
Pitfall: Unexpected `\n' in Input |
|
|
238 | (3) |
|
|
|
241 | (2) |
|
Programming Example: Editing a Text File |
|
|
243 | (1) |
|
Predefined Character Functions |
|
|
244 | (3) |
|
Pitfall: toupper and tolower Return Values |
|
|
247 | (2) |
|
|
|
249 | (20) |
|
Inheritance Among Stream Classes |
|
|
249 | (4) |
|
Programming Example: Another new_line Function |
|
|
253 | (1) |
|
Default Arguments for Functions (Optional) |
|
|
254 | (2) |
|
|
|
256 | (1) |
|
Answers to Self-Test Exercises |
|
|
257 | (7) |
|
|
|
264 | (5) |
|
|
|
269 | (64) |
|
|
|
271 | (11) |
|
Structures for Diverse Data |
|
|
271 | (5) |
|
Pitfall: Forgetting a Semicolon in a Structure Definition |
|
|
276 | (1) |
|
Structures as Function Arguments |
|
|
276 | (1) |
|
Programming Tip: Use Hierarchical Structures |
|
|
277 | (2) |
|
|
|
279 | (3) |
|
|
|
282 | (33) |
|
Defining Classes and Member Functions |
|
|
282 | (5) |
|
Public and Private Members |
|
|
287 | (6) |
|
Programming Tip: Make All Member Variables Private |
|
|
293 | (2) |
|
Programming Tip: Define Accessor and Mutator Functions |
|
|
295 | (2) |
|
Programming Tip: Use the Assignment Operator with Objects |
|
|
297 | (1) |
|
Programming Example: BankAccount Class--Version 1 |
|
|
297 | (5) |
|
Summary of Some Properties of Classes |
|
|
302 | (2) |
|
Constructors for Initialization |
|
|
304 | (8) |
|
Programming Tip: Always Include a Default Constructor |
|
|
312 | (1) |
|
Pitfall: Constructors with No Arguments |
|
|
313 | (2) |
|
|
|
315 | (18) |
|
Classes to Produce Abstract Data Types |
|
|
315 | (4) |
|
Programming Example: Alternative Implementation of a Class |
|
|
319 | (4) |
|
|
|
323 | (1) |
|
Answers to Self-Test Exercises |
|
|
324 | (5) |
|
|
|
329 | (4) |
|
|
|
333 | (70) |
|
Using Boolean Expressions |
|
|
335 | (8) |
|
Evaluating Boolean Expressions |
|
|
335 | (4) |
|
Pitfall: Boolean Expressions Convert to int Values |
|
|
339 | (2) |
|
Functions That Return a Boolean Value |
|
|
341 | (1) |
|
Enumeration Types (Optional) |
|
|
342 | (1) |
|
|
|
343 | (21) |
|
|
|
343 | (1) |
|
Programming Tip: Use Braces in Nested Statements |
|
|
343 | (4) |
|
Multiway if-else Statements |
|
|
347 | (2) |
|
Programming Example: State Income Tax |
|
|
349 | (3) |
|
|
|
352 | (4) |
|
Pitfall: Forgetting a break in a switch Statement |
|
|
356 | (1) |
|
Using switch Statements for Menus |
|
|
357 | (1) |
|
Programming Tip: Use Function Calls in Branching Statements |
|
|
357 | (1) |
|
|
|
357 | (6) |
|
Pitfall: Inadvertent Local Variables |
|
|
363 | (1) |
|
More About C++ Loop Statements |
|
|
364 | (15) |
|
The while Statements Reviewed |
|
|
364 | (2) |
|
Increment and Decrement Operators Revisited |
|
|
366 | (3) |
|
|
|
369 | (4) |
|
Pitfall: Extra Semicolon in a for Statement |
|
|
373 | (2) |
|
|
|
375 | (2) |
|
Pitfall: Uninitialized Variables and Infinite Loops |
|
|
377 | (1) |
|
|
|
377 | (1) |
|
Pitfall: The break Statement in Nested Loops |
|
|
377 | (2) |
|
|
|
379 | (24) |
|
Loops for Sums and Products |
|
|
379 | (2) |
|
|
|
381 | (3) |
|
|
|
384 | (5) |
|
|
|
389 | (3) |
|
|
|
392 | (1) |
|
Answers to Self-Test Exercises |
|
|
393 | (5) |
|
|
|
398 | (5) |
|
Friends and Overloaded Operators |
|
|
403 | (52) |
|
|
|
405 | (23) |
|
Programming Example: An Equality Function |
|
|
405 | (4) |
|
|
|
409 | (2) |
|
Programming Tip: Define Both Accessor Functions and Friend Functions |
|
|
411 | (2) |
|
Programming Tip: Use Both Member and Nonmember Functions |
|
|
413 | (1) |
|
Programming Example: Money Class (Version 1) |
|
|
413 | (7) |
|
Implementation of digit_to_int (Optional) |
|
|
420 | (1) |
|
Pitfall: Leading Zeros in Number Constants |
|
|
421 | (2) |
|
The const Parameter Modifier |
|
|
423 | (1) |
|
Pitfall: Inconsistent Use of const |
|
|
424 | (4) |
|
|
|
428 | (27) |
|
|
|
428 | (3) |
|
Constructors for Automatic Type Conversion |
|
|
431 | (2) |
|
Overloading Unary Operators |
|
|
433 | (1) |
|
|
|
434 | (11) |
|
|
|
445 | (1) |
|
Answers to Self-Test Exercises |
|
|
445 | (7) |
|
|
|
452 | (3) |
|
Separate Compilation and Namespaces |
|
|
455 | (36) |
|
|
|
457 | (14) |
|
|
|
457 | (1) |
|
Case Study: DigitalTime--A Class Compiled Separately |
|
|
458 | (10) |
|
|
|
468 | (2) |
|
Programming Tip: Defining Other Libraries |
|
|
470 | (1) |
|
|
|
471 | (20) |
|
Namespaces and using Directives |
|
|
471 | (2) |
|
|
|
473 | (3) |
|
|
|
476 | (1) |
|
A Subtle Point About Namespaces (Optional) |
|
|
477 | (1) |
|
|
|
478 | (6) |
|
Programming Tip: Choosing a Name for a Namespace |
|
|
484 | (1) |
|
Pitfall: Confusing the Global Namespace and the Unnamed Namespace |
|
|
484 | (2) |
|
|
|
486 | (1) |
|
Answers to Self-Test Exercises |
|
|
486 | (2) |
|
|
|
488 | (3) |
|
|
|
491 | (76) |
|
|
|
493 | (9) |
|
Declaring and Referencing Arrays |
|
|
493 | (1) |
|
Programming Tip: Use for Loops with Arrays |
|
|
494 | (1) |
|
Pitfall: Array Indexes Always Start with Zero |
|
|
494 | (2) |
|
Programming Tip: Use a Defined Constant for the Size of an Array |
|
|
496 | (1) |
|
|
|
496 | (2) |
|
Pitfall: Array Index Out of Range |
|
|
498 | (1) |
|
|
|
498 | (4) |
|
|
|
502 | (22) |
|
Indexed Variables as Function Arguments |
|
|
502 | (2) |
|
Entire Arrays as Function Arguments |
|
|
504 | (3) |
|
The const Parameter Modifier |
|
|
507 | (2) |
|
Pitfall: Inconsistent Use of const Parameters |
|
|
509 | (1) |
|
Functions That Return an Array |
|
|
510 | (1) |
|
Case Study: Production Graph |
|
|
510 | (14) |
|
|
|
524 | (12) |
|
|
|
525 | (1) |
|
Programming Tip: Do Not Skimp on Formal Parameters |
|
|
525 | (3) |
|
Programming Example: Searching an Array |
|
|
528 | (3) |
|
Programming Example: Sorting an Array |
|
|
531 | (5) |
|
|
|
536 | (9) |
|
|
|
536 | (3) |
|
|
|
539 | (2) |
|
Programming Example: A Class for a Partially Filled Array |
|
|
541 | (4) |
|
|
|
545 | (22) |
|
Multidimensional Array Basics |
|
|
545 | (1) |
|
Multidimensional Array Parameters |
|
|
545 | (2) |
|
Programming Example: Two-Dimensional Grading Program |
|
|
547 | (5) |
|
Pitfall: Using Commas Between Array Indexes |
|
|
552 | (1) |
|
|
|
553 | (1) |
|
Answers to Self-Test Exercises |
|
|
553 | (6) |
|
|
|
559 | (8) |
|
|
|
567 | (48) |
|
An Array Type for Strings |
|
|
569 | (17) |
|
C-String Values and C-String Variables |
|
|
569 | (3) |
|
Pitfall: Using = and == with C Strings |
|
|
572 | (2) |
|
Other Functions in <cstring> |
|
|
574 | (4) |
|
C-String Input and Output |
|
|
578 | (3) |
|
C-String-to-Number Conversions and Robust Input |
|
|
581 | (5) |
|
The Standard string Class |
|
|
586 | (17) |
|
Introduction to the Standard Class string |
|
|
587 | (2) |
|
I/O with the Class string |
|
|
589 | (4) |
|
Programming Tip: More Versions of getline |
|
|
593 | (1) |
|
Pitfall: Mixing cin >> variable; and getline |
|
|
594 | (1) |
|
String Processing with the Class string |
|
|
595 | (2) |
|
Programming Example: Palindrome Testing |
|
|
597 | (6) |
|
Converting between string Objects and C Strings |
|
|
603 | (1) |
|
|
|
603 | (12) |
|
|
|
604 | (1) |
|
Pitfall: Using Square Brackets Beyond the Vector Size |
|
|
605 | (2) |
|
Programming Tip: Vector Assignment Is Well Behaved |
|
|
607 | (1) |
|
|
|
607 | (2) |
|
|
|
609 | (1) |
|
Answers to Self-Test Exercises |
|
|
610 | (2) |
|
|
|
612 | (3) |
|
Pointers and Dynamic Arrays |
|
|
615 | (46) |
|
|
|
617 | (11) |
|
|
|
617 | (7) |
|
|
|
624 | (1) |
|
Pitfall: Dangling Pointers |
|
|
625 | (1) |
|
Static Variables and Automatic Variables |
|
|
626 | (1) |
|
Programming Tip: Define Pointer Types |
|
|
626 | (2) |
|
|
|
628 | (9) |
|
Array Variables and Pointer Variables |
|
|
629 | (1) |
|
Creating and Using Dynamic Arrays |
|
|
629 | (6) |
|
Pointer Arithmetic (Optional) |
|
|
635 | (2) |
|
Multidimensional Dynamic Arrays (Optional) |
|
|
637 | (1) |
|
Classes and Dynamic Arrays |
|
|
637 | (24) |
|
Programming Example: A String Variable Class |
|
|
639 | (1) |
|
|
|
640 | (6) |
|
Pitfall: Pointers as Call-by-Value Parameters |
|
|
646 | (2) |
|
|
|
648 | (4) |
|
Overloading the Assignment Operator |
|
|
652 | (3) |
|
|
|
655 | (1) |
|
Answers to Self-Test Exercises |
|
|
655 | (2) |
|
|
|
657 | (4) |
|
|
|
661 | (40) |
|
Recursive Functions for Tasks |
|
|
663 | (12) |
|
Case Study: Vertical Numbers |
|
|
663 | (6) |
|
A Closer Look at Recursion |
|
|
669 | (1) |
|
Pitfall: Infinite Recursion |
|
|
670 | (2) |
|
|
|
672 | (1) |
|
|
|
673 | (1) |
|
Recursion versus Iteration |
|
|
674 | (1) |
|
Recursive Functions for Values |
|
|
675 | (5) |
|
General Form for a Recursive Function That Returns a Value |
|
|
675 | (1) |
|
Programming Example: Another Powers Function |
|
|
676 | (4) |
|
|
|
680 | (21) |
|
Recursive Design Techniques |
|
|
680 | (2) |
|
Case Study: Binary Search---An Example of Recursive Thinking |
|
|
682 | (7) |
|
Programming Example: A Recursive Member Function |
|
|
689 | (5) |
|
|
|
694 | (1) |
|
Answers to Self-Test Exercises |
|
|
695 | (3) |
|
|
|
698 | (3) |
|
|
|
701 | (28) |
|
Templates for Algorithm Abstraction |
|
|
703 | (11) |
|
|
|
704 | (3) |
|
Pitfall: Compiler Complications |
|
|
707 | (2) |
|
Programming Example: A Generic Sorting Function |
|
|
709 | (4) |
|
Programming Tip: How to Define Templates |
|
|
713 | (1) |
|
Pitfall: Using a Template with an Inappropriate Type |
|
|
714 | (1) |
|
Templates for Data Abstraction |
|
|
714 | (15) |
|
Syntax for Class Templates |
|
|
715 | (3) |
|
Programming Example: An Array Class |
|
|
718 | (6) |
|
|
|
724 | (1) |
|
Answers to Self-Test Exercises |
|
|
724 | (3) |
|
|
|
727 | (2) |
|
Pointers and Linked Lists |
|
|
729 | (42) |
|
|
|
731 | (21) |
|
|
|
731 | (4) |
|
|
|
735 | (1) |
|
Inserting a Node at the Head of a List |
|
|
736 | (4) |
|
|
|
740 | (1) |
|
|
|
741 | (2) |
|
|
|
743 | (2) |
|
Inserting and Removing Nodes Inside a List |
|
|
745 | (2) |
|
Pitfall: Using the Assignment Operator with Dynamic Data Structures |
|
|
747 | (3) |
|
Variations on Linked Lists |
|
|
750 | (2) |
|
|
|
752 | (19) |
|
|
|
752 | (1) |
|
Programming Example: A Stack Class |
|
|
752 | (6) |
|
|
|
758 | (1) |
|
Programming Example: A Queue Class |
|
|
759 | (5) |
|
|
|
764 | (1) |
|
Answers to Self-Test Exercises |
|
|
764 | (3) |
|
|
|
767 | (4) |
|
|
|
771 | (50) |
|
|
|
773 | (22) |
|
|
|
773 | (9) |
|
Constructors in Derived Classes |
|
|
782 | (2) |
|
Pitfall: Use of Private Member Variables from the Base Class |
|
|
784 | (2) |
|
Pitfall: Private Member Functions Are Effectively Not Inherited |
|
|
786 | (1) |
|
|
|
786 | (3) |
|
Redefinition of Member Functions |
|
|
789 | (2) |
|
Redefining versus Overloading |
|
|
791 | (3) |
|
Access to a Redefined Base Function |
|
|
794 | (1) |
|
|
|
795 | (3) |
|
Functions That Are Not Inherited |
|
|
795 | (1) |
|
Assignment Operators and Copy Constructors in Derived Classes |
|
|
796 | (1) |
|
Destructors in Derived Classes |
|
|
797 | (1) |
|
|
|
798 | (23) |
|
|
|
798 | (1) |
|
|
|
799 | (6) |
|
Virtual Functions and Extended Type Compatibility |
|
|
805 | (2) |
|
Pitfall: The Slicing Problem |
|
|
807 | (3) |
|
Pitfall: Not Using Virtual Member Functions |
|
|
810 | (1) |
|
Pitfall: Attempting to Compile Class Definitions Without Definitions for Every Virtual Member Function |
|
|
811 | (1) |
|
Programming Tip: Make Destructors Virtual |
|
|
811 | (2) |
|
|
|
813 | (1) |
|
Answers to Self-Test Exercises |
|
|
813 | (4) |
|
|
|
817 | (4) |
|
|
|
821 | (30) |
|
Exception-Handling Basics |
|
|
823 | (20) |
|
A Toy Example of Exception Handling |
|
|
823 | (9) |
|
Defining Your Own Exception Classes |
|
|
832 | (1) |
|
Multiple Throws and Catches |
|
|
832 | (1) |
|
Pitfall: Catch the More Specific Exception First |
|
|
832 | (5) |
|
Programming Tip: Exception Classes Can Be Trivial |
|
|
837 | (1) |
|
Throwing an Exception in a Function |
|
|
837 | (1) |
|
|
|
838 | (4) |
|
Pitfall: Exception Specification in Derived Classes |
|
|
842 | (1) |
|
Programming Techniques for Exception Handling |
|
|
843 | (8) |
|
When to Throw an Exception |
|
|
843 | (1) |
|
Pitfall: Uncaught Exceptions |
|
|
844 | (1) |
|
Pitfall: Nested try-catch Blocks |
|
|
845 | (1) |
|
Pitfall: Overuse of Exceptions |
|
|
845 | (1) |
|
Exception Class Hierarchies |
|
|
845 | (1) |
|
Testing for Available Memory |
|
|
845 | (1) |
|
|
|
846 | (1) |
|
|
|
847 | (1) |
|
Answers to Self-Test Exercises |
|
|
847 | (1) |
|
|
|
848 | (3) |
|
Standard Template Library |
|
|
851 | (50) |
|
|
|
853 | (14) |
|
|
|
853 | (1) |
|
|
|
854 | (5) |
|
|
|
859 | (4) |
|
Constant and Mutable Iterators |
|
|
863 | (1) |
|
|
|
864 | (1) |
|
Pitfall: Compiler Problems |
|
|
865 | (1) |
|
|
|
865 | (2) |
|
|
|
867 | (15) |
|
|
|
867 | (5) |
|
Pitfall: Iterators and Removing Elements |
|
|
872 | (1) |
|
Programming Tip: Type Definitions in Containers |
|
|
873 | (1) |
|
Container Adapters stack and queue |
|
|
873 | (1) |
|
Associative Containers set and map |
|
|
874 | (8) |
|
|
|
882 | (1) |
|
|
|
882 | (19) |
|
Running Times and Big-O Notation |
|
|
883 | (4) |
|
Container Access Running Times |
|
|
887 | (1) |
|
Nonmodifying Sequence Algorithms |
|
|
887 | (5) |
|
Container Modifying Algorithms |
|
|
892 | (1) |
|
|
|
892 | (3) |
|
|
|
895 | (1) |
|
|
|
896 | (1) |
|
Answers to Self-Test Exercises |
|
|
896 | (2) |
|
|
|
898 | (3) |
| Appendix 1 C++ Keywords |
|
901 | (1) |
| Appendix 2 Precedence of Operators |
|
902 | (2) |
| Appendix 3 The ASCII Character Set |
|
904 | (1) |
| Appendix 4 Some Library Functions |
|
905 | (7) |
| Appendix 5 The assert Statement |
|
912 | (1) |
| Appendix 6 Inline Functions |
|
913 | (1) |
| Appendix 7 Overloading the Array Index Square Brackets |
|
914 | (2) |
| Appendix 8 The this Pointer |
|
916 | (2) |
| Appendix 9 Overloading Operators as Member Operators |
|
918 | (3) |
| Index |
|
921 | |