/*------------------------------------------------------------------*/ /* teststackadt.c */ /*------------------------------------------------------------------*/ #include #include "stackadt.h" int main(int argc, char *argv[]) /* Test the Stack ADT. */ { Stack_T oStack1; Stack_T oStack2; /* Create and use two Stacks. */ oStack1 = Stack_new(); oStack2 = Stack_new(); Stack_push(oStack1, 1); Stack_push(oStack1, 2); Stack_push(oStack1, 3); Stack_push(oStack2, 4); Stack_push(oStack2, 5); Stack_push(oStack2, 6); while (! Stack_isEmpty(oStack1)) printf("%d\n", Stack_pop(oStack1)); while (! Stack_isEmpty(oStack2)) printf("%d\n", Stack_pop(oStack2)); Stack_free(oStack1); Stack_free(oStack2); return 0; }