Step Into Labs

Step Into C · Lesson 9 · Memory

How Memory Really Works

Watch variables, copies, pointers, the stack and the heap change byte by byte, then fix the classic bugs.

Part of Step Into C. The full lesson, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.

Pointers, the stack, the heap and most crashes in C stop being mysterious once you can see memory. This lesson shows it to you. Every scene below is a real C program with a live picture of memory next to it. Press Step (or the → key) to run one line at a time, and ◀ to go back.

In this lesson

Missions

  1. Make swap swap
  2. Room for the zero
  3. A counter that survives
  4. Plug the leak