home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_06_03
/
v6n3011a.txt
< prev
next >
Wrap
Text File
|
1989-09-28
|
679b
|
33 lines
char *strlower(string)
/* Transforms all characters in string to lower case */
char *string; /* String to transform */
{
char *pc;
/* Save the starting address */
pc = string;
while (*string)
{
if (isupper(*string))
*string = tolower(*string);
string++;
}
return pc;
}
Why not just:
while (*string)
{
*string = tolower(*string);
string++;
}
Personally I prefer:
for (; *string; string++)
*string = tolower(*string);