Check if character is blank
Checks whether c is a blank character.
A blank character is a space character used to separate words within a line of text.
The standard "C" locale considers blank characters the tab character ('\t') and the space character (' ').
Other locales may consider blank a different selection of characters, but they must all also be space characters by isspace.
For a detailed chart on what the different ctype functions return for each character of the standard ASCII character set, see the reference for the <cctype> header.
In C++, a locale-specific template version of this function (isblank) exists in header <locale>.
Compatibility note: Standardized in C99 (C++11).
- Character to be checked, casted to an int, or EOF.
A value different from zero (i.e., true) if indeed c is a blank character. Zero (i.e., false) otherwise.
/* isblank example */
int main ()
char str="Example sentence to test isblank\n";
if (isblank(c)) c='\n';
This code prints out the C string character by character, replacing any blank character by a newline character. Output:
- Check if character is a white-space (function
- Check if character has graphical representation (function
- Check if character is a punctuation character (function
- Check if character is alphanumeric (function
- isblank (locale)
- Check if character is blank using locale (function template