Function name : isascii
Header file : <ctype.h>
Function prototype : int isascii(int ch);
Function : Determine whether the character is ASCII code, that is, the character ASCII is between 0 and 127
Parameters: int ch character to be checked
Return value : ch is not ASCII, returns 0, ch is ASCII, returns non-0
Program example : Determine whether the input characters are ASCII characters
#include<ctype.h>#include<stdio.h>intmain(){charch;printf(inputacharacter:);ch=getchar();if(isascii(ch)){printf(%cisascii.,ch);} else{printf(%cisnotascii.,ch);}putchar('n');return0;}
Running results:
inputacharacter:ffisascii.