Group 4: References and Pointers
This group of topics relate to understanding how references and pointers works in C++.
References, pointers, and the differences between them are the source of a lot of bugs in complex C++ programs. Understanding them now will help avoid lots of trouble later. Additionally, understanding how the code we write uses a computer's memory is important for every programming language you use!
Topics
You will know that you have achieved this group of learning objectives when you are able to
- Goal 4A: References:
- Read, write, and visualize C++ code involving references.
- Goal 4B: Pointers:
- Read, write, and visualize C++ code involving:
- Pointers
- The indirection operator (
*
) - The index operator (
[]
) - The address-of operator (
&
) new
, anddelete
.
- Read, write, and visualize C++ code involving:
- Goal 4C: Memory Management:
- Recognize memory management issues, specifically:
- Memory leaks
- Double
deletes
- Dangling pointers.
- Correct these issues.
- Recognize memory management issues, specifically:
- Goal 4D: Reading Types:
- Use the inside-out rule to read, write, and use complicated C++ types involving pointers, references, arrays, and
const
.
- Use the inside-out rule to read, write, and use complicated C++ types involving pointers, references, arrays, and
Need More Practice?
This group of goals are addressed in the following places:
- Week 3 Lesson 2 (Goal 4A)
- Week 5 Lesson 1 (Goal 4B, Goal 4D)
- Week 5 Lesson 2 (Goal 4B, Goal 4C)
There is even more in this lesson, which is great for practice for second tries but not needed to when taking the first try:
- Week 7 Lesson 1 (Goal 4B, Goal 4C, Goal 4D)
(When logged in, completion status appears here.)