isalpha, __iscsymf, iswalpha, _ismbcalpha
Go Up to ctype.h Index
Header File
ctype.h, mbstring.h
Category
Classification Routines
Prototype
int isalpha(int c);
int __iscsymf(int c);
int iswalpha(wint_t c);
int _ismbcalpha(unsigned int c);
Description
Classifies an alphabetical character.
isalpha is a macro that classifies ASCII-coded integer values by table lookup. The macro is affected by the current locale's LC_CTYPE category. For the default C locale, c is a letter (A to Z or a to z).
You can make this macro available as a function by undefining (#undef) it.
Return Value
isalpha returns nonzero if c is a letter.
__iscsymf returns true if and only if the argument c is a letter or an underscore.
iswalpha returns nonzero if c is a wchar_t in the character set defined by the implementation.
_ismbcalpha returns true if and only if the argument c is a single-byte ASCII English letter.
Example
#include <stdio.h> #include <ctype.h> int main(void) { char c = 'C'; if (isalpha(c)) printf("%c is alphabetical\n",c); else printf("%c is not alphabetical\n",c); return 0; }
Portability
POSIX | Win32 | ANSI C | ANSI C++ | |
---|---|---|---|---|
isalpha |
+ |
+ |
+ |
+ |
__iscsymf |
+ |
|||
_ismbcalpha |
+ |
|||
iswalpha |
+ |
+ |
+ |