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

 #include   <ctype.h>

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

    toupper() converts 'c' to uppercase if 'c' is a lowercase letter. If
    not, it remains unchanged.

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

      Notes:    toupper() is a macro.  Since toupper() does not correctly
                handle 'c' arguments with side effects, the library
                contains a function version. The function version may be
                used if the definition of tolower() is removed using
                #undef, or if the header <ctype.h> is not included at
                all. The function tolower() is declared in <stdlib.h>.

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

    The following statements convert the characters in 'string' to
    uppercase before printing them out.

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

         char string[15] = "Alphabet Soup";
         int x;

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

See Also: isupper() islower() _toupper()

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