User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







c:ctype.h:isprint

Table of Contents

isprint

    int isprint(int chr);

tests if character is printable

C Sourcecode Example

#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
 
#include <ctype.h>
 
int main ( void )
{
  int i;
  char string[11]="Test -!&%1";
  for (i=0; i <= 11;i++)
    {
     if ( isprint(string[i]) != 0 )
      {
       printf("Character %i is printable char\n",i);
      }
    }
  return 0;
}

output

  cd@najai:~$ ./isprint 
  Character 0 is printable char
  Character 1 is printable char
  Character 2 is printable char
  Character 3 is printable char
  Character 4 is printable char
  Character 5 is printable char
  Character 6 is printable char
  Character 7 is printable char
  Character 8 is printable char
  Character 9 is printable char
  
advertising
c/ctype.h/isprint.txt · Last modified: 2013/01/22 22:02 (external edit)

Impressum Datenschutz