_strnextc
, _wcsnextc
, _mbsnextc
, _mbsnextc_l
Finds the next character in a string.
Important
_mbsnextc
and _mbsnextc_l
cannot be used in applications that execute in the Windows Runtime. For more information, see CRT functions not supported in Universal Windows Platform apps.
Syntax
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
);
Parameters
str
Source string.
locale
Locale to use.
Return value
Each of these functions returns the integer value of the next character in str
.
Remarks
The _mbsnextc
function returns the integer value of the next multibyte character in str
, without advancing the string pointer. _mbsnextc
recognizes multibyte-character sequences according to the multibyte code page currently in use.
If str
is NULL
, the invalid parameter handler is invoked, as described in Parameter validation. If execution is allowed to continue, errno
is set to EINVAL
and the function returns 0.
Security Note This API incurs a potential threat brought about by a buffer overrun problem. Buffer overrun problems are a frequent method of system attack, resulting in an unwarranted elevation of privilege. For more information, see Avoiding buffer overruns.
By default, this function's global state is scoped to the application. To change this behavior, see Global state in the CRT.
Generic-text routine mappings
Tchar.h routine | _UNICODE and _MBCS not defined |
_MBCS defined |
_UNICODE defined |
---|---|---|---|
_tcsnextc |
_strnextc |
_mbsnextc |
_wcsnextc |
_strnextc
and _wcsnextc
are single-byte-character string and wide-character string versions of _mbsnextc
. _wcsnextc
returns the integer value of the next wide character in str
; _strnextc
returns the integer value of the next single-byte character in str
. _strnextc
and _wcsnextc
are provided only for this mapping and shouldn't be used otherwise. For more information, see Using generic-text mappings and Generic-text mappings.
_mbsnextc_l
is identical except that it uses the locale parameter passed in instead. For more information, see Locale.
Requirements
Routine | Required header |
---|---|
_mbsnextc |
<mbstring.h> |
_mbsnextc_l |
<mbstring.h> |
_strnextc |
<tchar.h> |
_wcsnextc |
<tchar.h> |
For more compatibility information, see Compatibility.
See also
String manipulation
Locale
Interpretation of multibyte-character sequences
_strdec
, _wcsdec
, _mbsdec
, _mbsdec_l
_strinc
, _wcsinc
, _mbsinc
, _mbsinc_l
_strninc
, _wcsninc
, _mbsninc
, _mbsninc_l