Skip to content

Instantly share code, notes, and snippets.

@ibeauregard
Last active April 24, 2021 11:29
Show Gist options
  • Save ibeauregard/94e40017e60a67945a04c02613ec8a29 to your computer and use it in GitHub Desktop.
Save ibeauregard/94e40017e60a67945a04c02613ec8a29 to your computer and use it in GitHub Desktop.
int main()
{
IntStack* stack = IntStackClass.new();
for (int i = 5; i > 0; i--) {
stack->_->push(stack, i);
}
printf("At the top of the stack is `%d`\n\n", stack->_->peek(stack));
while (!stack->_->isEmpty(stack)) {
printf("`%d` was popped from the stack\n", stack->_->pop(stack));
}
stack->_->delete(&stack);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment