I. Overview
The character test function is included in the header file <ctype. h>
These are macro definitions, not real functions.
1) isalnum test whether the character is an English letter or number
#include <stdio.h>#include <ctype.h>int main(){ char str[]="12#$%sdfsfsf"; int i; for(i=0;str[i]!=0;++i)if(isalnum(str[i]))printf("%c is an alphanumberic character\n",str[i]); return 0;}
2) isalpha test for English letters
#include <stdio.h>#include <ctype.h>int main(){ char str[]="12#$%sdfsfsf"; int i; for(i=0;str[i]!=0;++i)if(isalpha(str[i]))printf("%c is an alpha character\n",str[i]); return 0;}
3) isascii test whether it is an ASCII character
#include <stdio.h>#include <ctype.h>int main(){ int i; for(i=125;i<130;++i)if(isascii(i))printf("%d is an ascii character\n",i); elseprintf("%d is not an ascii character\n",i); return 0;}
4) The isblank test character is a white space character
5) iscntrl (c) test whether it is an ASCII control code, that is, whether it is between 0 and 31.
6) isdigit test whether it is Arabic numerals
7) isgraph test whether it is a printable character, not a blank character (see 10)
8) islower test whether it is a lowercase English letter
9) isprint test whether the character is printable similar to isgraph
10) isspace test whether the characters are white spaces '', '\ t',' \ n', '\ F', and' \ V'
11) ispunct test whether it is a punctuation or special symbol
12) isupper test whether it is a capital English letter
13) isxdigit test whether the character is a hexadecimal number 0 1 2 2 3 4 5 6 7 8 9 A B C D E F