Header File
ctype.h, wctype.h, mbstring.h
Category
Classification Routines
Prototype
int isspace(int c);
int iswspace(wint_t c);
int _ismbcspace(unsigned int c);
Description
Tests for space character.
isspace is a macro that classifies ASCII-coded integer values by table lookup. The macro is affected by the current locale’s LC_CTYPE category.
You can make this macro available as a function by undefining (#undef) it.
Return Value
isspace returns nonzero if c is a space, tab, carriage return, new line, vertical tab, formfeed (0x09 to 0x0D, 0x20), or any other locale-defined space character.
Example
#include <stdio.h> #include <ctype.h> int main(void) { char c = 'C'; if (isspace(c)) printf("%c is white space\n",c); else printf("%c is not white space\n",c); return 0; }
Portability
|
POSIX |
Win32 |
ANSI C |
ANSI C++ |
isspace |
+ |
+ |
+ |
+ |
_ismbcspace |
|
+ |
|
|
iswspace |
|
+ |
+ |
+ |
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|