 |
|
|
|
|
Why Would You Use Pointers? |
|
|
|
| |
 |
|
|
|
|
The Stack and the Free Store |
|
|
|
| |
 |
|
|
|
|
new |
|
|
|
| |
 |
|
|
|
|
delete |
|
|
|
| |
 |
|
|
|
|
Memory Leaks |
|
|
|
| |
 |
|
|
|
|
Summary |
|
|
|
| |
 |
|
|
|
|
Q&A |
|
|
|
| |
|
|
|
|
|
Hour 10
Advanced Pointers |
|
|
|
| |
 |
|
|
|
|
Creating Objects on the Free Store |
|
|
|
| |
 |
|
|
|
|
Deleting Objects |
|
|
|
| |
 |
|
|
|
|
Accessing Data Members |
|
|
|
| |
 |
|
|
|
|
Member Data on the Free Store |
|
|
|
| |
 |
|
|
|
|
The this Pointer |
|
|
|
| |
 |
|
|
|
|
What's the this Pointer For? |
|
|
|
| |
 |
|
|
|
|
Stray or Dangling Pointers |
|
|
|
| |
 |
|
|
|
|
const Pointers |
|
|
|
| |
 |
|
|
|
|
const Pointers and const Member Functions |
|
|
|
| |
 |
|
|
|
|
const this Pointers |
|
|
|
| |
 |
|
|
|
|
Summary |
|
|
|
| |
 |
|
|
|
|
Q&A |
|
|
|
| |
| |
 |
|
|
|
|
What Is a Reference? |
|
|
|
| |
 |
|
|
|
|
Creating a Reference |
|
|
|
| |
 |
|
|
|
|
Using the Address of Operator on References |
|
|
|
| |
 |
|
|
|
|
What Can Be Referenced? |
|
|
|
| |
 |
|
|
|
|
Null Pointers and Null References |
|
|
|
| |
 |
|
|
|
|
Passing Function Arguments by Reference |
|
|
|
| |
 |
|
|
|
|
Making swap() Work with Pointers |
|
|
|
| |
 |
|
|
|
|
Implementing swap() with References |
|
|
|
| |
 |
|
|
|
|
Understanding Function Headers and Prototypes |
|
|
|
| |
 |
|
|
|
|
Returning Multiple Values |
|
|
|
| |
 |
|
|
|
|
Returning Values by Reference |
|
|
|
| |
 |
|
|
|
|
Summary |
|
|
|
| |
 |
|
|
|
|
Q&A |
|
|
|
| |
|
|
|
|
|
Hour 12
Advanced References and Pointers |
|
|
|
| |
 |
|
|
|
|
Passing by Reference for Efficiency |
|
|
|
| |
 |
|
|
|
|
Passing a const Pointer |
|
|
|
| |
 |
|
|
|
|
References as an Alternative |
|
|
|
| |
 |
|
|
|
|
When to Use References and When to Use Pointers |
|
|
|
| |
 |
|
|
|
|
Don't Return a Reference to an Object that Isn't in Scope! |
|
|
|
| |