home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.pdx.edu / 2014.02.ftp.ee.pdx.edu.tar / ftp.ee.pdx.edu / pub / users / Harry / compilers / yapp / post.c < prev    next >
C/C++ Source or Header  |  2003-05-23  |  510b  |  27 lines

  1. /* post.c
  2. **
  3. ** Harry Porter - 10/30/98
  4. **
  5. ** This program removes all newline characters.  It also translates every
  6. ** dollar character ($) to a newline.  It is used to post-process output
  7. ** produced by PCAT programs, which have limited flexibility in outputting
  8. ** newlines.
  9. */
  10.  
  11. #include <stdio.h>
  12.  
  13. main () {
  14.   int c;
  15.   while (1) {
  16.     c = getchar();
  17.     if (c == '$') {
  18.       putchar ('\n');
  19.     } else if (c == '\n') {
  20.     } else if (c == EOF) {
  21.       return;
  22.     } else {
  23.       putchar(c);
  24.     } 
  25.   };
  26. }
  27.