codescracker


c

C isspace()



« Previous Chapter Next Function »


isspace()

The isspace() function returns non-zero if ch is a white-space character, including space, horizontal tab, vertical tab, formfeed, carriage return, or newline character; otherwise zero is returned.

isspace() Syntax

Following is the syntax of the isspace() function :

#include<ctype.h>
int isspace(int ch);

isspace() Example

Following program checks each character read from stdin and reports all white-space characters :

#include<ctype.h>
#include<stdio.h>
#include<conio.h>
void main()
{
	clrscr();
	char ch;
	for(; ;)
	{
		ch = getchar();
		if(isspace(ch))
			printf("%c is white space\n", ch);
		if(ch == '.')
			break;
	}
	getch();
}

« Previous Chapter Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test