isblank - cppreference.com
Namespaces
Variants

isblank

From cppreference.com
< c | string | byte
Defined in header <ctype.h>
int isblank( int ch );
(since C99)

Checks if the given character is a blank character in the current C locale. In the default C locale, only space (0x20) and horizontal tab (0x09) are classified as blank.

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters

ch - character to classify

Return value

Non-zero value if the character is a blank character, zero otherwise.

Example

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

int main(void)
{
    for (int ndx = 0; ndx != UCHAR_MAX; ++ndx)
        if (isblank(ndx))
            printf("0x%02x\n", ndx);
}

Output:

0x09
0x20

References

  • C23 standard (ISO/IEC 9899:2024):
  • 7.4.1.3 The isblank function (p: TBD)
  • C17 standard (ISO/IEC 9899:2018):
  • 7.4.1.3 The isblank function (p: 145)
  • C11 standard (ISO/IEC 9899:2011):
  • 7.4.1.3 The isblank function (p: 201)
  • C99 standard (ISO/IEC 9899:1999):
  • 7.4.1.3 The isblank function (p: 182)

See also

checks if a wide character is a blank character
(function) [edit]
C++ documentation for isblank