If you've taken our data structures course, you've already implemented a stack. We're going to implement a stack again, but this time we're going to do it while manually managing the memory of generic pointers!
We'll get to have our first deeper exploration of "generics" in C (remember, that just means void *) as well as creating a data structure we will later use in our mark-and-sweep garbage collector.
Take a look at snekstack.h, specifically the Stack struct.
count is the number of elements in the stack.capacity is the number of elements the stack can hold before it needs to be resized in memory.data is a pointer to all the generic data.Implement the stack_new function: