The Heap vs. the Stack
The freedom that makes the heap useful — arbitrary object lifetimes —
is exactly what makes it dangerous. A pointer can outlive the memory it
points to.
The freedom that makes the heap useful — arbitrary object lifetimes —
is exactly what makes it dangerous. A pointer can outlive the memory it
points to.