/* * CAT1 -- program to copy standard input to standard output * * Usage: cat1 * * Inputs: what is to be copied * Output: copied input * Exit Code: EXIT_SUCCESS (0) because all goes well * * written for ECS 030, Fall 2015 * * Matt Bishop, Sept. 28, 2015 * original program written */ #include #include /* * copy input to output: short version */ int main(void) { int c; /* input character */ /* * copy the input to the output * one char at a time */ while ((c = getchar()) != EOF) putchar(c); /* * say goodbye */ return(EXIT_SUCCESS); }