_strnextc, _wcsnextc, _mbsnextc, _mbsnextc_l

查找字符串中的下一个字符。

重要

_mbsnextc_mbsnextc_l 无法用于在 Windows 运行时中执行的应用程序。 有关详细信息,请参阅通用 Windows 平台应用中不支持的 CRT 函数

语法

unsigned int _strnextc(
   const char *str
);
unsigned int _wcsnextc(
   const wchar_t *str
);
unsigned int _mbsnextc(
   const unsigned char *str
);
unsigned int _mbsnextc_l(
   const unsigned char *str,
   _locale_t locale
);

参数

str
资源字符串。

locale
要使用的区域设置。

返回值

其中每个函数均返回 str 中下一个字符的整数值。

注解

_mbsnextc 函数返回 str 中下一个多字节字符的整数值,而不前移字符串指针。 _mbsnextc 根据当前使用的多字节代码页识别多字节字符序列。

如果 strNULL,则会调用无效的参数处理程序,如参数验证中所述。 如果允许执行继续,则将 errno 设置为 EINVAL,并且该函数将返回 0。

安全说明 此 API 会引发由缓冲区溢出问题带来的潜在威胁。 缓冲区溢出问题是常见的系统攻击方法,使权限的提升不能确保。 有关详细信息,请参阅避免缓冲区溢出

默认情况下,此函数的全局状态范围限定为应用程序。 若要更改此行为,请参阅 CRT 中的全局状态

一般文本例程映射

Tchar.h 例程 _UNICODE_MBCS 未定义 _MBCS 已定义 _UNICODE 已定义
_tcsnextc _strnextc _mbsnextc _wcsnextc

_strnextc_wcsnextc_mbsnextc 的单字节字符字符串和宽字符字符串版本。 _wcsnextc 返回 str 中下一个宽字符的整数值;_strnextc 返回 str 中下一个单字节字符的整数值。 仅为此映射提供 _strnextc_wcsnextc,否则不应该使用它们。 有关详细信息,请参阅使用一般文本映射一般文本映射

_mbsnextc_l 是相同的,只不过它改用传递的区域设置参数。 有关详细信息,请参阅 Locale

要求

例程 必需的标头
_mbsnextc <mbstring.h>
_mbsnextc_l <mbstring.h>
_strnextc <tchar.h>
_wcsnextc <tchar.h>

有关兼容性的详细信息,请参阅 兼容性

另请参阅

字符串操作
区域设置
多字节字符序列的解释
_strdec_wcsdec_mbsdec_mbsdec_l
_strinc_wcsinc_mbsinc_mbsinc_l
_strninc_wcsninc_mbsninc_mbsninc_l