◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back► ─────Run-Time Library─────────────────────────────────────────────────────── The mbstowcs function converts <count> or fewer multibyte characters pointed to by <mbstr> to a string of corresponding wide characters that are determined by the current locale. It stores the resulting wide-character string at the address represented by <wcstr>. The result is similiar to a series of calls to the mbtowc function. If mbstowcs encounters the null character ('\0') either before or when <count> occurs, it converts the null character to a wide-character null character (L'\0') and stops. Thus, the wide-character string at <wcstr> is null-terminated only if a null character is encountered during conversion. If the sequences pointed to by <wcstr> and <mbstr> overlap, the behavior is undefined. The _fmbstowcs function is a model-independent (large-model) form of the mbstowcs function. It can be called from any point in any program. Return Value If mbstowcs or _fmbstowcs successfully converts the <source> string, it returns the number of converted multibyte characters. If either function encounters an invalid multibyte character, it returns -1. If the return value is <count>, the wide-character string is not null-terminated. -♦-