/* An example program that uses King's stack implementation * - Takes input from standard input, to EOF, prints out input backwards * by popping it off the stack. */ #include #include "stack.h" int main () { int ch; make_empty(); while ((ch = getchar()) != EOF) { push(ch); } while(!is_empty()) { putchar(pop()); } return (1); }