home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / 18 / upercas2.c < prev   
Encoding:
C/C++ Source or Header  |  1988-08-11  |  862 b   |  33 lines

  1. /************************************************************************
  2.  *                                                                      *
  3.  * UPPERCAS.C                                                           *
  4.  *    This routine converts a fixed string to uppercase and prints it.  *
  5.  *                                                                      *
  6.  ***********************************************************************/
  7.  
  8. #include <ctype.h>
  9. #undef toupper
  10. #undef tolower
  11. #include <string.h>
  12. #include <stdio.h>
  13.  
  14. main(argc,argv)
  15.  
  16. int argc;
  17. char *argv[];
  18.  
  19. {
  20. char    *cp,c; 
  21.  
  22.         cp = "a string\n";
  23.      
  24.         /*  Convert *cp to uppercase and write to standard output  */
  25.  
  26.         while (*cp != '\0')
  27.                 {
  28.                 c = toupper(*cp++);
  29.                 putchar(c);
  30.                 }
  31.  
  32. }
  33.