towupper (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Convert character to uppercase.

int towupper( wint_t c );

Parameters

  • c
    Character to convert.

Return Values

This routine converts a copy of c, if possible, and returns the result.

If c is a wide character for which iswlower is nonzero and there is a corresponding wide character for which iswupper is nonzero, towupper returns the corresponding wide character; otherwise, towupper returns c unchanged.

There is no return value reserved to indicate an error.

Remarks

These functions are supported by all versions of the C run-time libraries.

This routine converts a given lowercase letter to an uppercase letter if possible and appropriate.

Example

Description

This program uses toupper and tolower to analyze all characters between 0x0 and 0x7F. It also applies _toupper and _tolower to any code in this range for which these functions make sense.

Code

#include <conio.h>
#include <ctype.h>
#include <string.h>

char msg[] = "Some of THESE letters are Capitals\r\n";
char *p;

void main( void )
{
   _cputs( msg );

   /* Reverse case of message. */
   for( p = msg; p < msg + strlen( msg ); p++ )
   {
      if( islower( *p ) )
         _putch( _toupper( *p ) );
      else if( isupper( *p ) )
         _putch( _tolower( *p ) );
      else
         _putch( *p );
   }
}
// Output
Some of THESE letters are Capitals
sOME OF these LETTERS ARE cAPITALS

Requirements

OS Versions: Windows CE 2.0 and later.

Header: condio.h, ctype.h, string.h.

Link Library: coredll.dll.

See Also

towlower

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.