Week 10 - Intro to Pointers and Dynamic Data
Learning Objectives
Upon finishing this learning module, you should be able to:
- Read code that uses pointers and references
- Create dynamically allocated storage
Important Upcoming Assessments
Schedule
Day 1
Enums CPP Lab
Start final assignment 9B
Day 2
- Pointer Basics
- Read chapter 11.1-11.3
- Pointer Worksheet
Day 3
- Dynamic Memory
- Read chapter 11.9
Day 4
- Quiz 4
- Final review
- Finish final assignment 9B
Enums
Read about enumerations in Appendix G of the textbook. This video covers the key ideas:
Do Enums CPP Lab
Typedef & Namepsaces
These are topics you should know about and recognize, but will not be using frequently. Don't worry about mastery, just make sure you understand these tools when you see them.
This video covers the core ideas:
Our book doesn't have great coverage, but you can use Leancpp.com as a reference to skim for more info: Typedef page and Namespaces page
Pointers
Read chapter 11.1-11.3 about the basics of pointers. This video helps explain what they are:
Do the Pointer worksheet from the Classroom files link. This video explains how to do the problems:
This C++ Code Visualizer can be a handy tool for visualizing what is happening in memory. It shows pointers as arrows to the location they point. That is a good high level mental model, but you should also understand that the pointer is storing something - a memory address.
Dynamic Memory
Watch this video about dynamic memory:
Read 11.9.
Final Review
The final is next week! Check in Elearn in the Files area for the Practice Final.
Practice doing it with pen and paper - you will not be able to use VSCode for the midterm!