wcstombs
Converts a wchar_t array into a multibyte string.
Defined in header <stdlib.h>
Syntax
#include <stdlib.h>
size_t wcstombs(char *s, const wchart *pzvcs, size_t n);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ | ■ | ■ |
Remarks
wcstombs converts the type wchar_t elements contained in pwcs into a multibyte character string s. The process terminates if either a null character or an invalid multibyte character is encountered.
No more than n bytes are modified. If n number of bytes are processed before a null character is reached, the array s will not be null terminated.
The behavior of wcstombs is affected by the setting of LC_CTYPE category of the current locale.
Return value
If an invalid multibyte character is encountered, wcstombs returns (sizet) -1. Otherwise, the function returns the number of bytes modified, not including the terminating code, if any.
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/stdlib.h/wcstombs/
· short form /3.1/wcstombs/