Memory Management part I
- This is chapter 7.
- Read up to 234, Smart pointers.
- We will deal with raw pointers first.
- We will come back later and deal with smart pointers.
- As a c++ programmer, people will expect you to know about pointers.
- you probably encountered this at the end of 230
- But you need a refresher.
- Or to even go over it again.
- Read the second and third paragraphs on page 211
- What is dynamic memory?
- Why is this type of memory needed?
- Where have you seen it in use?
- What is the stack?
- What is the heap?
- What do the operators new and delete do?
- How is this different from new[] and delete[]?
- What is NULL, nullptr?
- What does this do
int * x;
- What does this do
x = &y;
- What does this do
*x = 99;
- What does this do
cout << *x;
- Take a look at array.cpp.
- What is a shallow copy and a deep copy?