淡泊明志 宁静致远
分类: C/C++
2006-12-08 23:00:05
【C语言库函数源代码】
【本程序在Dev C++ 4.9.9.2 下编译通过】
int my_isspace( int ch )
{
return (unsigned int)(ch - 9)
< 5u || ch == ' ';
}//判断字符c是否为空白符。空白符指空格、水平制表、垂直制表、换页、回车和换行符。
int main()
{
char ch = '
';
if(my_isspace(ch))
printf("%c is Space
Character!\n",ch);
else
printf("%c is not a Space Character!\n",ch);
ch = '\n';
if(my_isspace(ch))
printf("%c is Space
Character!\n",ch);
else
printf("%c is not a Space
Character!\n",ch);
ch = '1';
if(my_isspace(ch))
printf("%c is Space
Character!\n",ch);
else
printf("%c is not a Space Character!\n",ch);
system("pause");
return 0;
}