Function name : isprint
Header file : <ctype.h>
Function prototype : int isprint(int ch);
Function : Determine whether the character is a printable character (including spaces)
Parameters : int ch character to be checked
Return value : If ch is not a printable character, 0 is returned. If ch is a printable character (including spaces), non-0 is returned.
Program example : Determine whether the entered characters are printable characters (including spaces)
#include<ctype.h>#include<stdio.h>intmain(){charch;printf(inputacharacter:);scanf(%c,&ch);if(isprint(ch)){printf(%cisprintcharacter.,ch) ;}else{printf(%cisnotprintcharacter.,ch);}putchar('n');return0;}
Running results:
inputacharacter:ggisprintcharacter.