home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / TOUPPER.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.7 KB  |  47 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - toupper.c
  3.  *
  4.  * function(s)
  5.  *        toupper - translates characters to upper-case
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*[]------------------------------------------------------------[]*/
  9. /*|                                                              |*/
  10. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  11. /*|                                                              |*/
  12. /*|                                                              |*/
  13. /*|     Copyright (c) 1987,1988,1990 by Borland International    |*/
  14. /*|     All Rights Reserved.                                     |*/
  15. /*|                                                              |*/
  16. /*[]------------------------------------------------------------[]*/
  17.  
  18. #include <ctype.h>
  19.  
  20. /*---------------------------------------------------------------------*
  21.  
  22. Name            toupper - translates characters to upper-case
  23.  
  24. Usage           int toupper(int c);
  25.  
  26. Prototype in    toupper is a function that converts an integer c (in the range
  27.                 EOF to 255) to its upper-case value (if it was lower-case): all
  28.                 others are left unchanged.
  29.  
  30. Return value    returns the converted value of c, on success, and
  31.                 nothing on failure.
  32.  
  33. *---------------------------------------------------------------------*/
  34. int _CType toupper( int ch )
  35.   {
  36.   if( ch == -1 )  return( -1 );
  37.  
  38.   if( islower((unsigned char)ch) )
  39.     {
  40.     return( _toupper((unsigned char)ch) );
  41.     }
  42.   else
  43.     {
  44.     return( (unsigned char)ch );
  45.     }
  46.   }
  47.