isprint

Tests for a printable character (function or macro)

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Character Manipulation

Syntax

  #include <ctype.h>  
   
  int isprint  ( 
     int   c);
  

Parameters

c
(IN) Specifies the character to be tested.

Return Values

isprint returns a nonzero value when the argument is a printable character. Otherwise, a value of 0 is returned.

Remarks

The isprint function or macro tests for any printable character, including a space character.

See Also

isalnum, isalpha, iscntrl, isdigit, islower, ispunct, isspace, isupper, isxdigit, tolower, toupper

Example

  #include <stdlib.h>  
  #include <ctype.h>  
  #include <stdio.h>  
   
  main()  
  {  
     int i;  
     while((i = getch()) != ’0’)  
        printf("%s\r\n",isprint(i) ? "yes" : "no");  
  }