C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
wcstombs, _fwcstombs
 Summary Example                         Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
     The wcstombs function converts <count> or fewer wide characters
     pointed to by <wcstr> to the corresponding multibyte characters
     and stores the results in the <mbstr> array.
 
     If wcstombs encounters the wide-character null character (L'\0')
     either before or when <count> occurs, it converts it to the
     multibyte null character (a 16-bit 0) and stops. Thus, the
     multibyte character string at <mbstr> is null-terminated only if
     wcstombs encounters a wide-character null character during
     conversion. If the sequences pointed to by <wcstr> and <mbstr>
     overlap, the behavior of wcstombs is undefined.
 
     The _fwcstombs function is a model-independent (large-model) form
     of the wcstombs function.
 
     Return Value
 
     If either wcstombs or _fwcstombs successfully converts the
     multibyte string, it returns the number of converted multibyte
     characters, excluding the wide-character null character. If either
     function encounters a wide character that cannot be converted to a
     multibyte character, it returns -1 cast to type size_t.
                                    -♦-