wcstombs function — Converts a wide string to a multibyte string
size_t wcstombs(char* dst, const wchar_t* src, size_t n)
The wcstombs
function
converts a wide string src
to a
string dst
of multibyte
characters. At most, n
bytes of
dst
are written to. If the
conversion of src
requires fewer
than n
bytes, a trailing null
byte is appended to dst
.
If any wide characters cannot be represented as a multibyte
character, static_cast<size_t>(-1)
is returned.
Otherwise, the return value is the number of bytes written to
dst
(not counting a trailing null
byte).