Introduction |
|
1 | (4) |
|
|
|
Hour 1 Writing Your First Program |
|
|
5 | (10) |
|
|
5 | (1) |
|
|
6 | (3) |
|
Compiling and Linking the Source Code |
|
|
9 | (1) |
|
Creating Your First Program |
|
|
10 | (5) |
|
Hour 2 Organizing the Parts of a Program |
|
|
15 | (14) |
|
|
15 | (4) |
|
|
19 | (3) |
|
|
22 | (1) |
|
|
23 | (6) |
|
Hour 3 Creating Variables and Constants |
|
|
29 | (14) |
|
|
29 | (4) |
|
|
33 | (2) |
|
Assigning Values to Variables |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
37 | (6) |
|
Hour 4 Using Expressions, Statements, and Operators |
|
|
43 | (20) |
|
|
43 | (1) |
|
|
44 | (1) |
|
|
45 | (8) |
|
If-Else Conditional Statements |
|
|
53 | (3) |
|
|
56 | (2) |
|
|
58 | (5) |
|
|
63 | (18) |
|
|
63 | (1) |
|
Declaring and Defining Functions |
|
|
64 | (2) |
|
Using Variables with Functions |
|
|
66 | (3) |
|
|
69 | (1) |
|
Returning Values from Functions |
|
|
70 | (2) |
|
Default Function Parameters |
|
|
72 | (2) |
|
|
74 | (7) |
|
Hour 6 Controlling the Flow of a Program |
|
|
81 | (16) |
|
|
81 | (1) |
|
|
81 | (4) |
|
|
85 | (1) |
|
|
86 | (4) |
|
|
90 | (7) |
|
Hour 7 Storing Information in Arrays and Strings |
|
|
97 | (14) |
|
|
97 | (2) |
|
Writing Past the End of Arrays |
|
|
99 | (1) |
|
|
100 | (1) |
|
|
101 | (3) |
|
|
104 | (2) |
|
|
106 | (5) |
|
|
|
Hour 8 Creating Basic Classes |
|
|
111 | (14) |
|
|
111 | (1) |
|
|
112 | (1) |
|
|
112 | (2) |
|
|
114 | (1) |
|
Private Versus Public Access |
|
|
115 | (1) |
|
Implementing Member Functions |
|
|
116 | (2) |
|
Creating and Deleting Objects |
|
|
118 | (7) |
|
Hour 9 Moving into Advanced Classes |
|
|
125 | (12) |
|
|
125 | (1) |
|
Interface Versus Implementation |
|
|
126 | (1) |
|
Organizing Class Declarations and Function Definitions |
|
|
126 | (1) |
|
|
127 | (2) |
|
Classes with Other Classes as Member Data |
|
|
129 | (8) |
|
Part III Memory Management |
|
|
|
Hour 10 Creating Pointers |
|
|
137 | (18) |
|
Understanding Pointers and Their Usage |
|
|
137 | (9) |
|
|
146 | (9) |
|
Hour 11 Developing Advanced Pointers |
|
|
155 | (14) |
|
Creating Objects on the Heap |
|
|
155 | (1) |
|
|
155 | (2) |
|
Accessing Data Members Using Pointers |
|
|
157 | (1) |
|
|
158 | (2) |
|
|
160 | (1) |
|
Stray or Dangling Pointers |
|
|
161 | (1) |
|
|
162 | (1) |
|
Const Pointers and const Member Functions |
|
|
163 | (6) |
|
Hour 12 Creating References |
|
|
169 | (16) |
|
|
169 | (1) |
|
|
170 | (1) |
|
Using the Address of Operator on References |
|
|
171 | (2) |
|
|
173 | (1) |
|
Null Pointers and Null References |
|
|
174 | (1) |
|
Passing Function Arguments by Reference |
|
|
174 | (5) |
|
Understanding Function Headers and Prototypes |
|
|
179 | (1) |
|
Returning Multiple Values |
|
|
179 | (6) |
|
Hour 13 Developing Advanced References and Pointers |
|
|
185 | (16) |
|
Passing by Reference for Efficiency |
|
|
185 | (3) |
|
|
188 | (3) |
|
References as an Alternative to Pointers |
|
|
191 | (1) |
|
When to Use References and When to Use Pointers |
|
|
192 | (1) |
|
Don't Return a Reference to an Object That Isn't in Scope! |
|
|
193 | (1) |
|
Returning a Reference to an Object on the Heap |
|
|
194 | (2) |
|
Pointer, Pointer, Who Has the Pointer? |
|
|
196 | (5) |
|
|
|
Hour 14 Calling Advanced Functions |
|
|
201 | (14) |
|
Overloaded Member Functions |
|
|
201 | (2) |
|
|
203 | (2) |
|
|
205 | (1) |
|
|
206 | (9) |
|
Hour 15 Using Operator Overloading |
|
|
215 | (18) |
|
|
215 | (10) |
|
|
225 | (8) |
|
Part V Inheritance and Polymorphism |
|
|
|
Hour 16 Extending Classes with Inheritance |
|
|
233 | (20) |
|
|
233 | (3) |
|
|
236 | (2) |
|
Constructors and Destructors |
|
|
238 | (3) |
|
Passing Arguments to Base Constructors |
|
|
241 | (4) |
|
|
245 | (8) |
|
Hour 17 Using Polymorphism and Derived Classes |
|
|
253 | (16) |
|
Polymorphism Implemented with Virtual Methods |
|
|
253 | (4) |
|
How Virtual Member Functions Work |
|
|
257 | (12) |
|
Hour 18 Making Use of Advanced Polymorphism |
|
|
269 | (20) |
|
Problems with Single Inheritance |
|
|
269 | (4) |
|
|
273 | (16) |
|
Hour 19 Storing Information in Linked Lists |
|
|
289 | (14) |
|
Linked Lists and Other Structures |
|
|
289 | (1) |
|
|
290 | (9) |
|
|
299 | (4) |
|
|
|
Hour 20 Using Special Classes, Functions, and Pointers |
|
|
303 | (28) |
|
|
303 | (2) |
|
|
305 | (2) |
|
|
307 | (6) |
|
Friend Classes and Functions |
|
|
313 | (18) |
|
Hour 21 Using New Features of C++Ox |
|
|
331 | (12) |
|
|
331 | (1) |
|
|
332 | (1) |
|
Compile-Time Constant Expressions |
|
|
333 | (2) |
|
|
335 | (3) |
|
|
338 | (5) |
|
Hour 22 Employing Object-Oriented Analysis and Design |
|
|
343 | (30) |
|
|
343 | (1) |
|
Simulating an Alarm System |
|
|
344 | (7) |
|
|
351 | (22) |
|
Hour 23 Creating Templates |
|
|
373 | (16) |
|
|
373 | (1) |
|
Instances of the Template |
|
|
374 | (1) |
|
|
374 | (7) |
|
|
381 | (8) |
|
Hour 24 Dealing with Exceptions and Error Handling |
|
|
389 | (20) |
|
Bugs, Errors, Mistakes, and Code Rot |
|
|
389 | (1) |
|
|
390 | (1) |
|
|
391 | (4) |
|
Using try and catch Blocks |
|
|
395 | (5) |
|
Writing Professional-Quality Code |
|
|
400 | (9) |
|
|
|
Appendix A Binary and Hexadecimal |
|
|
409 | (10) |
|
|
410 | (1) |
|
|
410 | (4) |
|
|
414 | (5) |
|
|
419 | (8) |
|
Appendix C This Book's Website |
|
|
427 | (2) |
Index |
|
429 | |