2019-07-01 18:06:21 -07:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
#include "stack.h"
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
Stack_T stk;
|
2019-07-02 16:02:55 -07:00
|
|
|
stk = Stack_init();
|
|
|
|
|
Stack_push(stk, (int *) 1);
|
|
|
|
|
Stack_push(stk, (int *) 2);
|
|
|
|
|
Stack_push(stk, (int *) 3);
|
|
|
|
|
Stack_push(stk, (int *) 4);
|
2019-07-01 18:06:21 -07:00
|
|
|
printf("Size: %d\n", Stack_size(stk));
|
2019-07-02 16:02:55 -07:00
|
|
|
Stack_print(stk);
|
|
|
|
|
Stack_pop(stk);
|
|
|
|
|
printf("Stack after popping: \n");
|
|
|
|
|
Stack_print(stk);
|
|
|
|
|
Stack_pop(stk);
|
|
|
|
|
printf("Stack after popping: \n");
|
|
|
|
|
Stack_print(stk);
|
2019-07-01 18:06:21 -07:00
|
|
|
return 0;
|
|
|
|
|
}
|