wcrtomb
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <wchar.h> 中定义
|
||
一个宽字符转换成窄的多字节表示.
原文:
Converts a wide character to its narrow multibyte representation.
s
是不是一个空指针,函数的数量决定了需要存储的字节的多字节字符表示wc
(包括任何移位序列),和存储多字节字符表示的字符数组,该数组的第一个元素是指向s
。通过此功能可以写在最MB_CUR_MAX字节.原文:
If
s
is not a null pointer, the function determines the number of bytes necessary to store the multibyte character representation of wc
(including any shift sequences), and stores the multibyte character representation in the character array whose first element is pointed to by s
. At most MB_CUR_MAX bytes can be written by this function.s
是一个空指针,调用等效wcrtomb(buf, L'\0', ps)一些内部缓冲区buf
.原文:
If
s
is a null pointer, the call is equivalent to wcrtomb(buf, L'\0', ps) for some internal buffer buf
.,如果WC是空的宽字符L'\0',空字节存储,在此之前通过必要的任何变化序列,恢复初始移位状态的更新和转换状态参数*ps代表初始位移状态的.
原文:
If wc is the null wide character L'\0', a null byte is stored, preceded by any shift sequence necessary to restore the initial shift state and the conversion state parameter *ps is updated to represent the initial shift state.
目录 |
[编辑] 参数
s | - | 窄字符数组的多字节字符将被存储的指针
原文: pointer to narrow character array where the multibyte character will be stored |
wc | - | 宽字符转换
|
ps | - | 解释的多字节字符串时使用的转换状态对象的指针
原文: pointer to the conversion state object used when interpreting the multibyte string |
[编辑] 返回值
如果成功,则返回写入的字符数组,该数组的第一个元素是指向
s
的字节数(包括任何移位序列). 原文:
On success, returns the number of bytes (including any shift sequences) written to the character array whose first element is pointed to by
s
. 失败(如果wc是不是一个有效的宽字符),返回(size_t)-1,店EILSEQerrno不明确的状态,并留下*ps.
原文:
On failure (if wc is not a valid wide character), returns (size_t)-1, stores EILSEQ in errno, and leaves *ps in unspecified state.
[编辑] 示例
本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
一个宽字符转换成多字节表示 原文: converts a wide character to its multibyte representation (函数) | |
下的多字节字符转换为宽字符,给定的状态中 原文: converts the next multibyte character to wide character, given state (函数) | |
C++ documentation for wcrtomb
|