isspace

Tests for a white-space character (function or macro)

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

Syntax

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

Parameters

c
(IN) Specifies the character to be tested.

Return Values

isspace returns a nonzero value when the argument is one of the indicated white-space characters. Otherwise, a value of 0 is returned.

Remarks

The isspace function or macro tests for the following white-space characters:

` ’

Space

\f

Formfeed

\n

Newline or line feed

\r

Carriage return

\t

Horizontal tab

\v

Vertical tab

See Also

isalnum, isalpha, iscntrl, isdigit, islower, isprint, ispunct, 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",isspace(i) ? "yes" : "no");  
  }