← 🧱 Runtime Environments
Subtopic 4 of 4

7.4Storage organisation: static, stack, heap

Static: fixed at compile time (globals). Stack: procedure calls, LIFO, recursion. Heap: dynamic allocation with explicit or garbage-collected lifetime. Stack and heap grow toward each other.

■ code■ static■ heap (grows →)■ stack (grows ←)

Click buttons to allocate and free.

Static data has a fixed address. Stack follows LIFO call order. Heap lifetime is explicit and unrelated to calls.

Previous year questions: Runtime Environments (2)

PYQs are grouped by topic, so this is the full set for Runtime Environments; try the ones that match this subtopic. Open all 2 on the topic page.