C Reference Convert to lower case: tolower()

The function tolower() returns a lowercase character of the character that is put in.

tolower() source code example:


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

int main()
{
	int counter=0;
	char mychar;
	char str[]="TeSt THis seNTeNce.\n";

	while (str[counter])
	{
		mychar=str[counter];
		putchar (tolower(mychar));
		counter++;
	}
	return 0;
}


Note: the sentence will be converted to all lowercase letters.

This entry was posted in C Reference ctype.h Functions. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed. Tweet This! Tweet This! or use to share this post with others.

There are currently 2 responses to “C Reference Convert to lower case: tolower()”

Why not let us know what you think by adding your own comment!

  1. mash on February 10th, 2010:

    Thank u so much =).

  2. hemant sehgal on April 11th, 2014:

    thanx!! it helped me at a crucial time!!