

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
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
Up until now, even though we made our stack with void *, you'll notice that we've only stored plain old int pointers. I want to show you that you can actually store anything in the stack, even heterogeneous lists! That being said, this is usually a bad idea.
TJ likes to use words like "heterogeneous" to keep kids-who-don't-read-good at bay. He meant to say, "you can actually store anything in the stack, even lists of different types of data!"
Now, we're going to do something pretty gross to demonstrate the wise words of one of the philosophers of our time:
With great power comes great responsibility.
-- Uncle Ben
I'm going to have you push an int * and a regular old int directly onto the stack (a bad idea). I just want to show you that you can store anything in a void *, even values that aren't pointers at all.
Complete the scary_double_push function.