Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
A computer's memory is the amount of fast non-permanent data (RAM)
that is, among others, used for calculations.
C++ uses the following major distinct memory areas [1]:
- Const data: const data known at compile time
- Stack: automatic variables that live in their scope
- Free store: dynamic memory area allocated/freed by new/delete. Prefer using the free store [2]
- Heap: dynamic memory area allocated/freed by malloc/free. Avoid using the heap [3]
- Global/static: global/static variables that are initialized at program startup
- Herb Sutter. Exceptional C++. ISBN: 0-201-61562-2. Item 35: Memory Management - Part 1: Table 1
- Herb Sutter. Exceptional C++. ISBN: 0-201-61562-2. Item 35: 'Prefer using the free store (new/delete)'
- Herb Sutter. Exceptional C++. ISBN: 0-201-61562-2. Item 35: 'Avoid using the heap (malloc/free)'
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.
