Site hosted by Angelfire.com: Build your free website today!
 The C Programming Language Non-course specific 

White Space

1 DESCRIPTION

White space characters are defined as blanks (spaces), horizontal and vertical tabs, newlines, carriage returns and formfeeds.

C provides a function which determines if its argument represents a white space character. The function is isspace and is defined in the header file <ctype.h>.

The argument is an int, and the value held in it must be EOF or representable as an unsigned char. This means the value passed to the function must be EOF (a negative value, usually -1, but not always) or it must be in the range 0 to UCHAR_MAX.

When using isspace, it's safest to call it like this:

   isspace( (unsigned char)c );
where c is the variable holding the character to be tested.

If the value passed into isspace is outside the expected range, the behaviour is undefined.

Back to C Home Page


Martin O'Brien <martin.o_brien@which.net>

Last update: 9 May 1999