Integer type (typically 4 bytes, -2,147,483,648 to 2,147,483,647)
1st Parameter
A single-byte character to be converted to a wide character, or EOF
Read more about parameters of btowc in parameters section
The btowcfunction in C language Converts a single-byte character to a wide character.
The btowc function determines the wide character corresponding to c, if c is a valid single-byte character in the initial shift state. This function is useful when working with mixed single-byte and wide character strings. It's important to note that this function is affected by the LC_CTYPE category of the current locale.
The btowcfunction takes 1
parameter:
•
int `c`: A single-byte character to be converted to a wide character, or EOF
Converts a single-byte character to a wide character. If the input character is valid, the corresponding wide character is returned. If the input is EOF or invalid, `WEOF` is returned.
The btowc function return value :
Returns the wide character corresponding to c if c is a valid single-byte character in the initial shift state
If c is EOF or if c is not a valid single-byte character in the initial shift state, the function returns WEOF
Output
This example demonstrates the basic usage of the `btowc` function to convert a single-byte character 'A' to its wide character equivalent.