Converts a wide-character string into a multibyte character string.
#include <stdlib.h> size_t wcstombs ( char *s, const wchar_t *pwcs, size_t n);
(OUT) Points to the array of multibyte characters.
(IN) Points to the array of wide-character codes to be converted.
(IN) Specifies the maximum length of the s parameter.
If successful, returns the actual number of bytes stored in the s array. If the return value is equal to n, the string is not null-terminated.
If a wide-character code is encountered that cannot be converted, returns -1 and sets errno to the following:
The wcstombs function converts a sequence of wide-character codes from the array pointed to by pwcs into a sequence of multibyte characters and stores them in the array pointed to by s. The wcstombs function stops if a multibyte character would exceed the limit of n total bytes, or if the null-terminating character is stored. At most, n bytes are modified.