Converts a wide-character string to a multibyte character string.
#include <wchar.h> size_t wcsrtombs ( char *dst, const wchar_t **src, size_t len, mbstate_t *ps);
(OUT) Points to the converted multibyte string.
(IN) Points to the wide-character string to convert.
(IN) Specifies the number of wide characters to convert.
(IN) Points to the conversion state of the character sequence. If ps is a NULL pointer, wcsrtombs uses its own state, which is initialized at program startup. A thread-safe application must not pass a NULL pointer.
If successful, returns the number of bytes converted, not including the null-terminating character (if any). Otherwise, returns -1 and sets errno to one of the following:
The wcsrtombs function converts a sequence of wide characters from the array pointed to by src into a sequence of corresponding characters, beginning in the conversion state described by the object pointed to by ps. If dst is not a NULL pointer, the converted characters are stored into the array pointed to by dst. Conversion continues up to and including a null-terminating wide character, which is also stored. Conversion stops earlier in the following cases:
When a code is reached that does not correspond to a valid character
When the next character would exceed the limit of len total bytes to be stored in the array pointed to by dst (and dst is not a NULL pointer)
Each character conversion takes place as if the wcrtomb function has been called.