CONTENTS | INDEX | PREV | NEXT

 isprint

 NAME
  isprint - check for a printable character, includes the space character

 SYNOPSIS
  int r = isprint(c);
  int c;

  This is a MACRO if you #include <ctype.h>, a subroutine call if
  you do not.

 FUNCTION
  Returns non-zero if the character is printable, zero otherwise.

  This function is the isgraph() function but with space character
  included in the printable set.

 NOTE
  When a non-zero value is returned, this value can be *anything*
  other than zero.  It is not necessarily a 1.  It is guarenteed to
  fit in a short, however, and still remain non-zero.

  characters in the 128-255 range are valid inputs.  characters
  less than -1 or larger than 255 are ILLEGAL and the results will
  be random.  If you are passing a CHAR, you must cast it to an
  UNSIGNED CHAR first.

  EOF is a valid input and always returns false

 EXAMPLE
  #include <ctype.h>
  #include <assert.h>

  main()
  {
      assert(isprint(' '));
      assert(isprint('^'));
      assert(!isprint(23));
      assert(!isprint(127));
  }

 INPUTS
  int c;      character that we are checking

 RESULTS
  int r;      0 if the check failed, non-zero if the check is true