wcstombs


function
<cstdlib>
size_t wcstombs ( char * mbstr, const wchar_t * wcstr, size_t max );

Convert wide-character string to multibyte string

The C wchar_t string wcstr is interpreted character by character and translated to its multibyte equivalent, which is stored in the location pointed by mbstr. The length in bytes of the resulting multibyte string, not including the ending null-character, is returned.

Parameters

mbstr
Pointer to an array of char elements at least max bytes long.
wcstr
C wchar_t string to be translated.
max
Maximum number of bytes to be written to mbstr.


Return Value

The number of bytes (not characters) translated and written to mbstr, not including the ending null-character.
If an invalid multibyte character is encountered, a -1 value is returned.

See also