/************************************************************************/ /* */ /* COPYRIGHT (C) G. KLYNE, 2004 */ /* */ /************************************************************************/ /* * * Module name : EchoShiftLetters * File name : EchoShiftLetters.c * * * AMENDMENT RECORD * ================ * * 1. V00.1A 29-Apr-1996 Graham Klyne * Module initially created. * * * MODULE FUNCTION * =============== * Read characters from standard input, and echo them to standard * output replacing each letter with its uppercase equivalent. * * When the end of inptu is reached, report the number of * characters processed to standard error. * */ /************************************************************************/ /* External declarations used */ /************************************************************************/ // #include // #include #include #include int main( int argc, char * argv[], char * envp[] ) { /*-- Local variable declarations -----------------------------*/ char c ; int i = 0 ; /*-- Copy standard input to standard output --------------------*/ while ( !feof(stdin) && ( ferror(stdin) == 0 ) ) { c = getc( stdin ) ; if ( c != EOF ) { putc( toupper(c), stdout ) ; i++ ; } } /*-- Report number of characters processed ---------------------*/ fprintf( stderr, "EchoShiftLetters: %d characters processed.\n", i ) ; return 0 ; } /* End of procedure main */ /************************************************************************/ /* End of module EchoShiftLetters */ /************************************************************************/