## 18.2 Common Memory Errors

- The programmer is responsible for memory management in C++
- Pointers can refer to memory in any of the four areas (above)
- Possible errors include:
  - Using a value that has not been initialized
  - Using a pointer to reference a memory location that is no longer valid (dangling pointer)
  - Forgetting to delete a dynamically allocated section of memory (memory leak)
  - Deleting a memory value that was never allocated
  - Deleting a dynamically allocated section of memory more than once

prev |top |next