Checks whether c is a blank character. A blank character is a space character used to separate words within a line of text.
int isblank ( int c );
This function has the following parameter.
A value different from zero (i.e., true) if indeed c is a blank character. Zero (i.e., false) otherwise.
#include <stdio.h>
#include <ctype.h>
//ww w .ja va 2 s . c o m
int main (){
char c;
int i=0;
char str[]="Example sentence to test isblank\n";
while (str[i])
{
c=str[i];
if (isblank(c)) c='\n';
putchar (c);
i++;
}
return 0;
}
The code above generates the following result.
#include <stdio.h>
#include <ctype.h>
#include <limits.h>
int main(void)
{
for (int ndx=0; ndx<=UCHAR_MAX; ndx++)
if (isblank(ndx)) printf("0x%02x\n", ndx);
}
The code above generates the following result.