Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>_toupper() convert 'c' to uppercase</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_toupper()               Convert 'c' to Uppercase

 #include   <ctype.h>

 int        _toupper(c);
 int        c;                           Character to be converted

    The _toupper() macro converts 'c' to uppercase.  It should only to be
    used when 'c' is known to be lowercase.  The result of _tolower() is
    undefined if 'c' is not a lowercase letter.

    Returns:    The converted character 'c'.  There is no error return.

      Notes:    Use toupper() to convert characters that are not
                necessarily lowercase letters.

  -------------------------------- Example ---------------------------------

    The following statements convert 'string' to uppercase if needed.

         #include <ctype.h>
         #include <stdio.h>

         char string[15] = "alphabet";
         int x;

         main()
         {
             for (x = 0; x < strlen(string); x++)
                 printf("%c",_toupper(string[x]));
             printf("\n");
         }

See Also: toupper() isupper() islower()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson