📄 mb
字号:
@c ----------------------------------------------------------------------
@node mblen, locale
@heading @code{mblen}
@subheading Syntax
@example
#include <stdlib.h>
int mblen(const char *s, size_t n);
@end example
@subheading Description
This function returns the number of characters of string @var{s} that
make up the next multibyte character. No more than @var{n} characters
are checked.
If @var{s} is @code{NULL}, the internal shift state is reset.
@subheading Return Value
The number of characters that comprise the next multibyte character.
@subheading Example
@example
int n = mblen(string, INT_MAX);
string += n;
@end example
@c ----------------------------------------------------------------------
@node mbstowcs, locale
@heading @code{mbstowcs}
@subheading Syntax
@example
#include <stdlib.h>
size_t mbstowcs(wchar_t *wcs, const char *s, size_t n);
@end example
@subheading Description
Converts a multibyte string to a wide character string. The result
will be no more than @var{n} wide characters.
@subheading Return Value
The number of wide characters stored.
@subheading Example
@example
int wlen = mbtowcs(wbuf, string, sizeof(wbuf)/sizeof(wchar_t));
@end example
@c ----------------------------------------------------------------------
@node mbtowc, locale
@heading @code{mbtowc}
@subheading Syntax
@example
#include <stdlib.h>
int mbtowc(wchar_t *pwc, const char *s, size_t n);
@end example
@subheading Description
Convert the first multibyte sequence in @var{s} to a wide character.
At most @var{n} characters are checked. If @var{pwc} is not
@code{NULL}, the result is stored there. If @var{s} is null, the
internal shift state is reset.
@subheading Return Value
The number of characters used by the multibyte sequence.
@subheading Example
@example
string += mbtowc(&wc, string, strlen(string));
@end example
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -