mbtowc.3int
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3INT 代码 · 共 82 行
3INT
82 行
.TH mbtowc 3int.SH Namembtowc \- converts a single multibyte character into a character of type wchar_t.SH Syntax#include <stdlib.h>.PPint mbtowc \fI(pwc, s, n)\fR.brwchar_t \fI*pwc;\fR.brconst char \fI*s;\fR.brsize_t\fI n;\fR.SH Arguments.TP 8.I pwcThe .I pwcargument is a pointer to the resulting object of type wchar_t..PP.TP 8.I sThe.I sargument is a pointer to a multibyte character..PP.TP 8.I nThe .I n argument is the maximum number of bytes of object .I sthat are examined. .SH Description.NXR "multibyte character to wide character conversion function"If \fIs\fR is not a null pointer,the .PN mbtowcfunction determines the number ofbytes that comprise the multibyte character pointed to by \fIs\fR.It then determines the character code for the value (of type wchar_t) thatcorresponds to that multibyte character (the value of the codecorresponding to the null character is zero). If the multibyte character is valid and \fIpwc\fR is not a null pointer,the .PN mbtowcfunction storesthe code in the object pointed to by \fIpwc\fR. At most\fIn\fR bytes of the array pointed to by \fIs\fR are examined.This function is affected by the LC_CTYPE category of thecurrent locale..SH Return ValuesIf \fIs\fR is a null pointer, the .PN mbtowcfunction returns a zero value.If \fIs\fR is not a null pointer,the .PN mbtowcfunction returns:.RS 3.IP \(bu 3 0, if \fIs\fR points to the null character.IP \(bu 3 The number of bytesthat comprise the converted multibye character, if the next \fIn\fRor fewer bytes form a valid multibye character.IP \(bu 3 - -1, if the next \fIn\fR or fewer bytes do not form a valid multibye character.RE.PPIn no case is the value returned greater than \fIn\fR or thevalue of the MB_CUR_MAX macro..SH See Alsomblen(3int), mbstowcs(3int), setlocale(3int), wctomb(3int), wcstombs(3int)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?