/*-------------------------------------------------------------------*/ /* teststack.c (Version 3: Data Modules) */ /*-------------------------------------------------------------------*/ #include "stack.h" #include int main(int argc, char *argv[]) { Stack_new(10); Stack_push(1.1); Stack_push(2.2); while (! Stack_empty()) printf("%g\n", Stack_pop()); Stack_free(); Stack_new(20); Stack_push(3.3); Stack_push(4.4); while (! Stack_empty()) printf("%g\n", Stack_pop()); Stack_free(); return 0; } /* Output: 2.2 1.1 4.4 3.3 */