wctomb
Converts wchart code to a multibyte character.
Defined in header <stdlib.h>
Syntax
#include <stdlib.h>
int wctomb(char *s, wchar_t wc);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ | ■ | ■ |
Remarks
If s is not null, wctomb determines the number of bytes needed to represent the multibyte character corresponding to wc (including any change in shift state). The multibyte character is stored in s.
| At most MB_CUR_MAX | characters are stored. If the value of wc is |
zero, wctomb is left in the initial state.
The behavior of wctomb is affected by the setting of LC_CTYPE category of the current locale.
Return value
If s is a null pointer, wctomb returns a nonzero or zero value, if multibyte characters encodings, respectively, do or do not have state-dependent encodings.
If s is not a null pointer, wctomb returns -1 if the wc value does not represent a valid multibyte character. Otherwise, wctomb returns the number of bytes that are contained in the multibyte character corresponding to wc. In no case will the return value be
| greater than the value of MB_CUR_MAX | macro. |
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/stdlib.h/wctomb/
· short form /3.1/wctomb/