previous |
start |
next
Pointers and Memory Allocation
- The C++ run-time system can create new objects
for us.
- When we create a new object, a memory
alllocator finds a storage location for the object.
- The memory allocator keeps a large storage
area, called the heap, for that purpose.
- The heap is a flexible pool of memory that can
hold values of any type.
- When you allocate a new heap object, the memory
allocator tells where the object is located, by giving you the
object's memory address.
- To manipulate memory addresses, you need to use
a pointer.
previous |
start |
next