An integer type capable of storing any wide character value or the special value WEOF, used in wide-character input/output functions.
1st Parameter
The wide character to be converted to a single-byte character.
Read more about parameters of wctob in parameters section
The wctobfunction in C language Attempts to convert a wide character to a single-byte character.
wctob determines whether c corresponds to a member of the extended character set whose multibyte character representation is a single byte when in the initial shift state. If so, wctob returns the single-byte representation of that character as an unsigned char converted to an int. The behavior of this function is affected by the LC_CTYPE category of the current locale.
The wctobfunction takes 1
parameter:
•
wint_t `wc`: The wide character to be converted to a single-byte character.
Converts the wide character `wc` to its corresponding single-byte character if possible. Returns the converted single-byte character as an `unsigned char`, or `EOF` if the wide character cannot be represented as a single byte.
The wctob function return value :
Returns the single-byte representation of the wide character, or EOF if the wide character does not correspond to a single-byte character
Output
This example demonstrates the basic usage of wctob to convert a wide character to a single-byte character.