wctomb

Converts a wide character to its multibyte character representation.

Format

#include  <stdlib.h>

int wctomb  (char *s, wchar_t wchar);

Arguments

s
A pointer to the resulting multibyte character.
wchar
The code for the wide character.

Description

This function converts the wide character specified by wchar to its multibyte character representation. If s is NULL, then 0 is returned. Otherwise, the number of bytes comprising the multibyte character is returned. At most, MB_CUR_MAX bytes are stored in the array object pointed to by s.

This function is affected by the LC_CTYPE category of the program's current locale.

Return Values
The number of bytes comprising the multibyte character corresponding to wchar
If s is NULL. 
-1  If wchar is not a valid character. 


Previous Page | Next Page | Table of Contents | Index