Converts a sequence of wide-character codes to a sequence of multibyte characters.
#include <stdlib.h> size_t wcstombs (char *s, const wchar_t *pwcs, size_t n);
This function is affected by the LC_CTYPE category of the program's current locale. See also wctomb in this section.
If s is NULL, this function call is a counting operation and n is ignored.
x | The number of bytes stored in s, not including the null terminating byte. If s is NULL, wcstombs returns the number of bytes required for the multibyte character array. |
(size_t) -1 | Indicates an error occurred. The function sets errno to EILSEQ - invalid character sequence, or a wide-character code does not correspond to a valid character. |