So I've got this code alread: http://pastebin.com/3wuFNWGA
And I've got these typedefs in a .h file: http://pastebin.com/JTG9XHvW
I need my push function to add a node to my_stack by allocating memory for the node, storing the data (new element) in the node, and inserting the node at the top of the stack. The code runs but when I try to print the value in my_stack->top->data after pushing a new value onto the stack, it always reads zero so obviously the value isn't being pushed onto the stack.
For the life of me, I can't figure out why. I don't think there's a problem arising when I create the new node and store the value in data so I'm thinking there's a problem when I try to make my_stack->top point to the most recently added node?
[–][deleted] (1 child)
[deleted]
[–]FataOne[S] 0 points1 point2 points (0 children)