Namespaces
Variants
Actions

std::wcsrtombs

From cppreference.com
< cpp‎ | string‎ | multibyte
Defined in header <cwchar>
std::size_t wcsrtombs( char* dst,

                       const wchar_t** src,
                       std::size_t len,

                       std::mbstate_t* ps );

Converts a sequence of wide characters from the array whose first element is pointed to by *src to its narrow multibyte representation that begins in the conversion state described by *ps. If dst is not null, converted characters are stored in the successive elements of the char array pointed to by dst. No more than len bytes are written to the destination array.

Each character is converted as if by a call to std::wcrtomb. The conversion stops if:

  • The null character was converted and stored. src is set to a null pointer and *ps represents the initial shift state.
  • A wchar_t was found that does not correspond to a valid character in the current C locale. src is set to point at the first unconverted wide character.
  • The next multibyte character to be stored would exceed len. src is set to point at the first unconverted wide character. This condition is not checked if dst is a null pointer.

Contents