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 6.0 - <b>tolower() convert 'c' to lowercase, if appropriate (macro)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 tolower()               Convert 'c' to lowercase, if Appropriate (Macro)

 #include   <ctype.h>

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

    tolower() is a macro that converts 'c' to lowercase.  The conversion
    is made if 'c' is an uppercase letter; if not, 'c' remains unchanged.

    Returns:    The converted character 'c'; no error return.

      Notes:    tolower() is a macro, but the library contains a function
                version (declared in <stdlib.h>) because the tolower()
                macro does not correctly handle 'c' arguments with side
                effects.  To use the function version, remove the
                definition of tolower() from <ctype.h> with #undef or do
                not include the header <ctype.h>.

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

    The following statements convert strings to lowercase before printing
    them.

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

           char string[15] = "ALPHABET SOUP";
           int x;

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


See Also: islower() isupper() _tolower()

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