Format
#include <ctype.h> int isblank(int c);
Language Level: Extension
isblank tests whether the current LC_CTYPE locale
category assigns c the blank character attribute.
The value for c must be representable as an unsigned character, or EOF.
In the "POSIX" and "C" locales, the tab and space characters have the blank attribute.
Return Value
isblank returns a nonzero value if the
integer c has the blank attribute; 0 if it does not.
Example
This example tests if c is a blank type.
#include <ctype.h> #include <locale.h> #include <stdio.h>
void check(char c) {
if ((' ' != c) && (isprint(c)))
printf(" %c is ", c);
else
printf("x%02x is ", c);
if (!isblank(c))
printf("not ");
puts("a blank type character");
return;
}
int main(void)
{
printf("In LC_CTYPE category of locale name \"%s\":\n",
setlocale(LC_CTYPE, NULL));
check('a');
check(' ');
check(0x00);
check('\n');
check('\t');
return 0;
/*******************************************************
The output should be similar to:
In LC_CTYPE category of locale name "C":
a is not a blank type character
x20 is a blank type character
x00 is not a blank type character
x0a is not a blank type character
x09 is a blank type character
*******************************************************/
}
![]()
isalnum to isxdigit
-- Test Integer Value
![]()
isascii
-- Test Integer Values
![]()
_iscsym
-- _iscsymf -- Test Integer
iswalnum
to iswxdigit -- Test Wide Integer
![]()
iswblank
-- Test for Wide Blank Character Classification
setlocale -- Set
Locale
<ctype.h>