#include <ctype.h>
int isspace(int c);
#include <stdio.h>
#include <ctype.h>
int main()
{
char str[] = "1 2\t345\nabc\rdef\ngh\v";
int i;
for (i = 0; str != 0; i++)
if (isspace(str))
printf ("str[%d] is a whitespace character: %d\n", i, str);
return 0;
}
./isspace
str[1] is a whitespace character: 32
str[3] is a whitespace character: 9
str[7] is a whitespace character: 10
str[11] is a whitespace character: 13
str[15] is a whitespace character: 10
str[18] is a whitespace character: 11
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |