#include <ctype.h>
|
int
isspace (int c); |
SPACE
FORM-FEED
NEWLINE
CARRIAGE-RETURN
TAB
VERTICAL-TAB
For single character representations, the value of the argument is representable as an unsigned char or the value of EOF.
The functionality of this API is independent of the program’s current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class space, irrespective of the locale they belong to.
#include<ctype.h> //isspace() #include<stdio.h> //printf() int test_isspace() { int arr[]={’\n’,’0’,’w’,’R’,0x3000,’ ’}; int i = 0; int size = 5; for( i=0; i<size; i++) { int ret = isspace(arr[i]); //call to the API with chars in arr[] if( (!ret) != 0 ) { printf("\n%c is not space char ", arr[i]); } else { printf("\n%c is space char", arr[i]); } } printf("\n"); }
Output
is space char 0 is not space char w is not space char R is not space char is space char
© 2005-2007 Nokia |