isascii, iswascii
Go Up to ctype.h Index
Header File
ctype.h, wctype.h
Category
Classification Routines
Prototype
int isascii(int c);
int iswascii(wint_t c);
Description
Character classification macro.
These functions depend on the LC_CTYPE
isascii is a macro that classifies ASCII-coded integer values by table lookup. It is a predicate returning nonzero for true and 0 for false.
isascii is defined on all integer values.
Return Value
isascii returns nonzero if c is in the range 0 to 127 (0x00-0x7F).
iswascii returns nonzero if c is is a wide-character representation of an ASCII character.
Each of these routines returns 0 if c does not satisfy the test condition.
Example
#include <stdio.h> #include <ctype.h> #include <stdio.h> int main(void) { char c = 'C'; if (isascii(c)) printf("%c is ascii\n",c); else printf("%c is not ascii\n",c); return 0; }
Portability
POSIX | Win32 | ANSI C | ANSI C++ | |
---|---|---|---|---|
isascii |
+ |
|||
iswascii |
+ |