wctomb.c
来自「基于4个mips核的noc设计」· C语言 代码 · 共 30 行
C
30 行
/* * 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 + =
减小字号Ctrl + -
显示快捷键?