[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
isgraph() Test for Printable Character Except Space
#include <ctype.h>
int isgraph(c);
int c; Integer value to be tested
isgraph() tests if 'c' is a printable character. The space character
(' ') is not considered a printable character.
Returns: True (nonzero) if the integer satisfies the test
condition or false (zero) if it does not. The result is
undefined if 'c' is other than an ASCII character or EOF.
Notes: isgraph() is a macro.
-------------------------------- Example ---------------------------------
The following statements read characters from a file until a space or
non-printable character is encountered.
#include <ctype.h>
#include <stdio.h> /* for fopen */
FILE *stream;
char buffr[80];
int ch, x = 0;
main()
{
if ((stream = fopen("input.dat","r+")) != NULL) {
while (isgraph(ch = fgetc(stream)))
buffr[x++] = ch;
}
}
See Also:
isalnum()
isalpha()
isascii()
iscntrl()
isdigit()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson