iswalpha
From cppreference.com
Defined in header <wctype.h>
|
||
int iswalpha( wint_t ch ); |
(since C95) | |
Checks if the given wide character is an alphabetic character, i.e. either an uppercase letter (ABCDEFGHIJKLMNOPQRSTUVWXYZ
), a lowercase letter (abcdefghijklmnopqrstuvwxyz
) or any alphabetic character specific to the current locale.
Contents |
[edit] Parameters
ch | - | wide character |
[edit] Return value
Non-zero value if the wide character is an alphabetic character, zero otherwise.
[edit] Notes
ISO 30112 specifies which Unicode characters are include in POSIX alpha category.
[edit] Example
Run this code
#include <locale.h> #include <stdio.h> #include <wchar.h> #include <wctype.h> int main(void) { wchar_t c = L'\u0b83'; // Tamil sign Visarga ('เฎ') printf("in the default locale, iswalpha(%#x) = %d\n", c, !!iswalpha(c)); setlocale(LC_ALL, "en_US.utf8"); printf("in Unicode locale, iswalpha(%#x) = %d\n", c, !!iswalpha(c)); }
Possible output:
in the default locale, iswalpha(0xb83) = 0 in Unicode locale, iswalpha(0xb83) = 1
[edit] References
- C23 standard (ISO/IEC 9899:2024):
- TBD The iswalpha function (p: TBD)
- C17 standard (ISO/IEC 9899:2018):
- 7.30.2.1.2 The iswalpha function (p: 327)
- C11 standard (ISO/IEC 9899:2011):
- 7.30.2.1.2 The iswalpha function (p: 448-449)
- C99 standard (ISO/IEC 9899:1999):
- 7.25.2.1.2 The iswalpha function (p: 394-395)
[edit] See also
checks if a character is alphabetic (function) | |
C++ documentation for iswalpha
|
ASCII values | characters |
isalpha |
|||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
decimal | hexadecimal | octal | |||||||||||||
0โ8 | \x0 โ\x8
|
\0 โ\10
|
control codes (NUL , etc.)
|
โ 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
9 | \x9
|
\11
|
tab (\t )
|
โ 0
|
0
|
โ 0
|
โ 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
10โ13 | \xA โ\xD
|
\12 โ\15
|
whitespaces (\n , \v , \f , \r )
|
โ 0
|
0
|
โ 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
14โ31 | \xE โ\x1F
|
\16 โ\37
|
control codes | โ 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
32 | \x20
|
\40
|
space | 0
|
โ 0
|
โ 0
|
โ 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
33โ47 | \x21 โ\x2F
|
\41 โ\57
|
!"#$%&'()*+,-./
|
0
|
โ 0
|
0
|
0
|
โ 0
|
โ 0
|
0
|
0
|
0
|
0
|
0
|
0
|
48โ57 | \x30 โ\x39
|
\60 โ\71
|
0123456789
|
0
|
โ 0
|
0
|
0
|
โ 0
|
0
|
โ 0
|
0
|
0
|
0
|
โ 0
|
โ 0
|
58โ64 | \x3A โ\x40
|
\72 โ\100
|
:;<=>?@
|
0
|
โ 0
|
0
|
0
|
โ 0
|
โ 0
|
0
|
0
|
0
|
0
|
0
|
0
|
65โ70 | \x41 โ\x46
|
\101 โ\106
|
ABCDEF
|
0
|
โ 0
|
0
|
0
|
โ 0
|
0
|
โ 0
|
โ 0
|
โ 0
|
0
|
0
|
โ 0
|
71โ90 | \x47 โ\x5A
|
\107 โ\132
|
GHIJKLMNOP QRSTUVWXYZ
|
0
|
โ 0
|
0
|
0
|
โ 0
|
0
|
โ 0
|
โ 0
|
โ 0
|
0
|
0
|
0
|
91โ96 | \x5B โ\x60
|
\133 โ\140
|
[\]^_`
|
0
|
โ 0
|
0
|
0
|
โ 0
|
โ 0
|
0
|
0
|
0
|
0
|
0
|
0
|
97โ102 | \x61 โ\x66
|
\141 โ\146
|
abcdef
|
0
|
โ 0
|
0
|
0
|
โ 0
|
0
|
โ 0
|
โ 0
|
0
|
โ 0
|
0
|
โ 0
|
103โ122 | \x67 โ\x7A
|
\147 โ\172
|
ghijklmnop qrstuvwxyz
|
0
|
โ 0
|
0
|
0
|
โ 0
|
0
|
โ 0
|
โ 0
|
0
|
โ 0
|
0
|
0
|
123โ126 | \x7B โ\x7E
|
\173 โ\176
|
{|}~
|
0
|
โ 0
|
0
|
0
|
โ 0
|
โ 0
|
0
|
0
|
0
|
0
|
0
|
0
|
127 | \x7F
|
\177
|
backspace character (DEL )
|
โ 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|