home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / advmsdos / chap15 / proto.c < prev   
Encoding:
C/C++ Source or Header  |  1988-10-01  |  688 b   |  36 lines

  1. /*
  2.     PROTO.C: prototype character-oriented filter
  3.  
  4.     Copyright 1988 Ray Duncan
  5.  
  6.     Build:  CL PROTO.C
  7.  
  8. */
  9.  
  10. #include <stdio.h>
  11.  
  12. main(int argc, char *argv[])
  13. {       
  14.     char ch;
  15.  
  16.     while((ch=getchar()) != EOF)    /* read a character */  
  17.     {   
  18.         ch = translate(ch);         /* translate it if necessary */
  19.  
  20.         putchar(ch);                /* write the character */
  21.     }       
  22.     exit(0);                        /* terminate at end of file */
  23. }
  24.  
  25.  
  26. /*
  27.     Perform any necessary translation on character 
  28.     from input file.  This example just returns 
  29.     the same character.
  30. */
  31.  
  32. int translate(char ch)
  33. {       
  34.     return (ch);
  35. }
  36.