The Runtime Theory
C++Planned

C++ Foundations

Video not available yet
14:00

C++ Foundations

Lesson Promise

By the end of this lesson, you will understand what pointers are, how the stack and heap work, how function calls use the call stack, and how to avoid the most common memory errors in C++.

Narration Draft

"C++ gives you direct control over memory — which makes it fast, but also dangerous. Every variable lives somewhere: on the stack (fast, automatic) or on the heap (slower, manual). Pointers are variables that hold memory addresses. Understanding this memory model is the key to writing correct, efficient C++ code."

Visual Sequence

  1. Scene 1 — Memory layout diagram showing text, data, heap, and stack segments (Diagram: cpp-memory-layout)
  2. Scene 2 — Pointer visualization: variable, address, dereference
  3. Scene 3 — Call stack trace showing main → foo → bar, stack frames pushed and popped (Trace: trace-function-call)
  4. Scene 4 — Common memory errors: leak, dangling pointer, double-free

Companion Material

Related articles

More in C++

New lessons by email

Get new articles and notes on the systems behind everyday software.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save