CS2263/Final/FinalCode/adt/stack.c

21 lines
434 B
C
Raw Permalink Normal View History

2023-05-22 23:28:51 -03:00
#include "stack.h"
int main() {
Stack *stack = createStack(8);
if (stack == NULL) {
printf("Stack creation failed\n");
return 1;
}
int i = 7;
int j = 8;
push(stack, i);
push(stack, j);
printf("%d\n", peek(stack));
printf("%d\n", search(stack, i));
pop(stack);
int k = 9;
push(stack, k);
printStack(stack);
deleteStack(stack);
return 0;
}