Prototype: int isspace (int c); header file: ctype.h function: Check if parameter C is a space character, that is, whether it is a space ('), a positional character (' \ t '), a CR (' \ R '), a newline (' \ n '), a vertical position character (' \v '), or a page ') situation. Return value: Returns true if the argument C is a space character, otherwise null (0) is returned. Additional notes: This is a macro definition, not a real function.
Analog Source implementation:
int isspace (int c) { return (c = = ' | | c = = ' \ t ' | | c = = ' \ n ' | | c = = ' \ r ' | | c = = ' \f ' | | c = = ' \v ');}
Application Examples:
#include <stdio.h> #include <ctype.h>main () { char str[]= "A3 4\t%\r8\n9 [\ve\f?"; int i = 0; for (i=0;str[i]!=0;i++) { if (isspace (Str[i])) { printf ("%c is a space \ n", Str[i]); } else { printf ("%c is not a space \ n", Str[i]);}} }
Operation Result:
Isspace String Test Function application Example