#include #include const int STACK_SIZE = 100; struct stack{ int count; int data[STACK_SIZE]; }; void stack_init(struct stack &the_stack) { the_stack.count = 0; } void stack_push(struct stack &the_stack, const int item) { the_stack.data[the_stack.count] = item; ++the_stack.count; } int stack_pop(struct stack &the_stack) { --the_stack.count; return(the_stack.data[the_stack.count]); } main() { struct stack a_stack; stack_init(a_stack); stack_push(a_stack, 1); stack_push(a_stack, 2); stack_push(a_stack, 3); //Pop the items from the stack cout << "Expect a 3 ->" << stack_pop(a_stack) << '\n'; cout << "Expect a 2 ->" << stack_pop(a_stack) << '\n'; cout << "Expect a 1 ->" << stack_pop(a_stack) << '\n'; return(0); }