summaryrefslogtreecommitdiff
path: root/c/dataStructure/栈和队列//链栈/main.c
blob: f211ae4b2d6fac24e3b2653316894ec0b4d76e14 (plain)
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) {
    Stack s;
    int p;

    InitStack(&s);

    for (int i = 0; i < 3; i++)
        Push(&s, i);
    
    for (int i = 0; i < 3; i++) {
        printf("Get top: %d\n",GetTop(&s));
        Pop(&s,&p);
        printf("Pop: %d\n",p);
    }

    DestroyStack(&s);

    return 0;
}