isspace C Library function

isspace function checks whether a character is white-space character or not. White-space characters are vertical tab('\v'), horizontal tab('\t'), newline('\n'), form feed('\f'), carriage return('\r'), and space(' ').

Function prototype of isspace

int isspace(int c);
Function isspace takes a character as input in form of an integer. When we pass a value of type char to isspace() function, corresponding ASCII value of that character is passed.

Return value of isspace

If passed character is a white-space character, then isspace function returns non-zero(true) integer otherwise 0(false).

C program using isspace function

The following program is to check whether a character is a white-space character or not.

#include <stdio.h>
#include <ctype.h>
#include <conio.h>

int main(){
    char string[] = "A \t";
    int index = 0;
    while(string[index] != '\0'){
            printf("'%c' is a space character\n", string[index]);
        } else {
            printf("'%c' is not a space character\n", 
    return 0;

'A' is not a space character
' ' is a space character
'        ' is a space character