

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Low Level Stack
incomplete
2: Stack Push
incomplete
3: Stack Pop
incomplete
4: Stack free
incomplete
5: Dangerous Push
incomplete
6: Multiple Types
incomplete
This lesson's interactive features are locked, please to keep using them
In C, we don't have a lot of abstractions at our disposal. There are no classes, destructors, functors, monads, made-up-category-theory-words, etc.
We've got data. And we've got functions. Just the way God Dennis Ritchie intended.
So, to make it easier to work with our Stack, we're going to build our own little free function that will clean up all the memory that we've allocated for our stack.
Complete the stack_free function.
You can assume all the elements inside the stack are already freed. That's not our problem.