This blog is under construction

Sunday, 18 March 2012

towlower

Header file:
    wctype.h

Synopsis:
    wint_t towlower (wint_t input)

Description:
    If the input is in uppercase letter, it returns the corresponding lower-case letter.  Otherwise input is returned unchanged.


Sample program for towlower in C:



  #include <stdio.h>
  #include <wchar.h>
  #include <wctype.h>
  int main() {
        wint_t wide_char;
        char input;
        printf("Enter your input:");
        input = getchar();

        /* btowc -Converts single byte to wide character format */
        wide_char = btowc(input);

        printf("Return value: %d\n", towlower(wide_char));
        return 0;
  }



  Output:
  Enter your input:A
  Result for the given input: a

No comments:

Post a Comment