tolower() Convert 'c' To Lowercase, If Appropriate
#include <ctype.h>
int tolower(c);
int c; Character to be converted
The tolower() macro converts 'c' to lowercase if 'c' is an uppercase
letter. If not, it remains unchanged.
Returns: The converted character 'c'. There is no error return.
Notes: tolower() is a macro. Since tolower() 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 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");
}
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster