1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include "stack.h" int main(void) { int p; Stack s; InitStack(&s); for (int i = 0; i < 8; i++) Push(&s,i); for (int i = 0; i < 8; i++) { printf("Get top: %d\n",GetTop(&s)); Pop(&s,&p); printf("Pop: %d\n",p); } DestroyStack(&s); return 0; }