Step Into C · Module exam · Memory
Exam: The Word Stack
Store any number of words on the heap, give them back in reverse, and leak nothing.
- ~40 minto solve
- 3hints
- membersaccess
- Clanguage
Part of Step Into C. The full module exam, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.
You do not know how many words are coming, or how long any of them is. A fixed-size array would either waste memory or overflow. Build a word stack that grows on the heap exactly as much as it needs, prints the words back in reverse order, and returns every byte it rented. The starter counts your blocks, so a leak cannot hide.
In this module exam
- The brief
- What this exam tests
Missions
- Grow, reverse, give back