Convert a wide-character code to a character
#include <wchar.h> size_t wcrtomb( char * s, wchar_t wc, mbstate_t * ps);
You can call mbsinit() to determine the status of this variable.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The wcrtomb() function determines the number of bytes needed to represent the wide character wc as a multibyte character and stores the multibyte character in the location pointed to by s, to a maximum of MB_CUR_MAX bytes.
This function is affected by LC_CTYPE.
The number of bytes stored, or (size_t)-1 if the variable wc is an invalid wide-character code.
ANSI, POSIX 1003.1
|Thread||Read the Caveats|
This function is safe to call in a multithreaded program if the ps argument isn't NULL.
wcsrtombs(), wcstod(), wcstof(), wcstold(), wcstoimax(), wcstoumax(), wcstok(), wcstol(), wcstoll(), wcstombs(), wcstoul(), wcstoull(), wctob(), wctomb()