📄 wctomb.c
字号:
/* * ansi/stdlib/wctomb.c * ANSI/ISO 9899-1990, Section 7.10.7.3. * * int wctomb(char *s, wchar_t wchar) * Convert wide character to multibyte character. * Assumes multibyte encoding as defined in mb_encode.h. */#include <stdlib.h>#include "mb_encode.h"intwctomb(char *s, wchar_t wchar){ if (s == NULL) return 0; /* encoding is not state-dependent */ if (is1byte(wchar)) { /* w encodes in one character */ *s = (char) wchar; return 1; } else { /* w encodes in three characters */ *s++ = byte1(wchar); *s++ = byte2(wchar); *s = byte3(wchar); return 3; }}/* end of wctomb.c */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -