CKTIS / C
isspace — C23 character classification function
`isspace(c)` from `<ctype.h>` returns a nonzero value for a white-space character in the current locale. In the `C` locale the class contains space, `\f`, `\n`, `\r`, `\t`, and `\v`, so it is broader than horizontal-only `isblank`.
Version: C23
Syntax
int isspace(int c);isspace(c) from <ctype.h> returns a nonzero value for a white-space character in the current locale. In the C locale the class contains space, \f, \n, \r, \t, and \v, so it is broader than horizontal-only isblank.
The example tests space, \n, \t, and A, normalizing with != 0. Output 1 1 1 0 demonstrates three kinds of white space and rejects the letter.
The argument must be EOF or representable as unsigned char; a negative plain char has undefined behavior. For a byte use isspace((unsigned char)ch), handling EOF separately. The class follows LC_CTYPE and does not automatically cover every Unicode separator; a protocol parser should define its own accepted set.
Examples
#include <ctype.h>
#include <stdio.h>
int main(void){int values[]={' ','\n','\t','A'};printf("%d %d %d %d\n",isspace(values[0])!=0,isspace(values[1])!=0,isspace(values[2])!=0,isspace(values[3])!=0);return 0;}
Result
1 1 1 0
The example tests space, `\n`, `\t`, and `A`, normalizing with `!= 0`. Output `1 1 1 0` demonstrates three kinds of white space and rejects the letter.