home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / 18 / upercas1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  831 b   |  31 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. #include <string.h>
  10. #include <stdio.h>
  11.  
  12. main(argc,argv)
  13.  
  14. int argc;
  15. char *argv[];
  16.  
  17. {
  18. char    *cp,c; 
  19.  
  20.         cp = "a string\n";
  21.      
  22.         /*  Convert *cp to uppercase and write to standard output  */
  23.  
  24.         while (*cp != '\0')
  25.                 {
  26.                 c = toupper(*cp++);
  27.                 putchar(c);
  28.                 }
  29.  
  30. }
  31.