tolower - C ctype.h

C examples for ctype.h:tolower

type

function

from

<cctype> 
<ctype.h>

Description

Convert uppercase letter to lowercase

Prototype

int tolower ( int c );

Parameters

Parameter Description
cCharacter to be converted, casted to an int, or EOF.

Return Value

The lowercase equivalent to c, if such value exists, or c (unchanged) otherwise.

Example

Demo Code

#include <stdio.h>
#include <ctype.h>
int main ()//w  ww . j  a  va2s . c  o  m
{
  int i=0;
  char str[]="Test String. this IS A TEST\n";
  char c;
  while (str[i])
  {
    c=str[i];
    putchar (tolower(c));
    i++;
  }
  return 0;
}

Related Tutorials