Check if wide character is alphanumeric
Checks whether c is either an alphabetic letter (either uppercase or lowercase) or a decimal digit.
The result is true if either iswalpha or iswdigit would also return true for c.
This function is the wide-character equivalent of isalnum (<cctype>): If c translates with wctob to a character for which isalnum is true, it is always considered alphanumeric by this function too.
In C++, a locale-specific template version of this function (isalnum) exists in header <locale> for all character types.
- Wide character to be checked, casted to a wint_t, or WEOF.
wint_t is an integral type.
A value different from zero (i.e., true) if indeed c is either a digit or a letter. Zero (i.e., false) otherwise.
/* iswalnum example */
int main ()
wchar_t str = L"c3po...";
while (iswalnum(str[i])) i++;
wprintf (L"The first %d characters are alphanumeric.\n",i);
The first 4 characters are alphanumeric.
- Check if character is alphanumeric (function
- Check if wide character is alphabetic (function
- Check if wide character is decimal digit (function
- isalnum (locale)
- Check if character is alphanumeric using locale (function template)