Clever Geek Handbook
📜 ⬆️ ⬇️

wctype.h

wctype.h - header file of the standard library of the C programming language. Contains functions for working with individual "wide" characters.

Standard library
C programming language
  • assert.h
  • complex.h (C99)
  • ctype.h
  • errno.h
  • fenv.h (C99)
  • float.h
  • inttypes.h (C99)
  • iso646.h
  • limits.h
  • locale.h
  • math.h
  • setjmp.h
  • signal.h
  • stdalign.h (C11)
  • stdarg.h
  • stdatomic.h (C11)
  • stdbool.h (C99)
  • stddef.h
  • stdint.h (C99)
  • stdio.h
  • stdlib.h
  • stdnoreturn.h (C11)
  • string.h
  • tgmath.h
  • threads.h (C11)
  • time.h
  • uchar.h (C11)
  • wchar.h
  • wctype.h

Functions

Functions for Separating Characters

FunctionDescription
iswalnumChecks if a character is a letter or a number
iswalphaChecks if a character is a letter
iswblankChecks if the character is “blank” (space, tab, etc.)
iswcntrlChecks if a character is a control character
iswdigitChecks if a character is a decimal digit
iswgraphChecks if a character has a graphical representation
iswlowerChecks if a character is a lowercase letter
iswprintChecks if a character is printable
iswpunctChecks if a character is a punctuation mark
iswspaceChecks if a character is a space
iswupperChecks if a character is uppercase
iswxdigitChecks if a character is a hexadecimal digit

Other Functions

FunctionDescription
towlowerReturns a lowercase character
towupperReturns an uppercase character
  wint_t towctrans ( wint_t c , wctrans_t desc );

The function transforms a character depending on the string desc .

 
 c = towctrans ( wint_t c , wctrans ( "toupper" ));  // convert c to uppercase
 c = towctrans ( wint_t c , wctrans ( "toulower" ));  // translate the character c to lowercase

Constants

WEOF - “wide” end of file


Usage Example

Convert a string to lowercase:

  #include <wchar.h> 
 #include <wctype.h> 

 int main ()
 {
     wchar_t str [] = L "Wikipedia. \ n " ;
     for ( size_t i = 0 ; str [ i ] ! = L '\ 0' ; i ++ ) 
     {
         putwchar ( towlower ( str [ i ]));
     }
     return 0 ;
 }

Links

  • wctype.h - Basic Definitions, The Single UNIX® Specification , Issue 7 by The Open Group
Source - https://ru.wikipedia.org/w/index.php?title=Wctype.h&oldid=83096833


More articles:

  • Don Cesar de Bazan (play)
  • Green (Sudak City Council)
  • Hre (language)
  • Rhododendron PJM Group
  • Joanne, Tony
  • Monument to Lenin (Irkutsk)
  • Shapiro, Chaim Nachman
  • Ziyati, Nureddin
  • Erastov, Oleg Alexandrovich
  • Thving language

All articles

Clever Geek | 2019