-
-
Save ibeauregard/84cb0f169697efd68dc3f7efa4917ec0 to your computer and use it in GitHub Desktop.
The main before introducing the destructor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() | |
{ | |
IntStack* stack = new_stack(); | |
for (int i = 5; i > 0; i--) { | |
push_to_stack(stack, i); | |
} | |
printf("At the top of the stack is `%d`\n\n", peek_stack(stack)); | |
while (!is_empty_stack(stack)) { | |
printf("`%d` was popped from the stack\n", pop_stack(stack)); | |
} | |
free(stack); stack = NULL; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment