Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stack.h"
- #include <stdio.h>
- int main() {
- stack s;
- int a = 4;
- int b = 3;
- int c = 2;
- push(&s, &c);
- push(&s, &a); //addr of since we're using a void pointer
- push(&s, &b);
- printf("%d\n", *((int*)pop(&s)));
- printf("%d\n", *((int*)pop(&s)));
- push(&s, &c);
- printf("%d\n", *((int*)pop(&s)));
- printf("%d\n", *((int*)pop(&s)));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement