淡泊明志 宁静致远
分类: C/C++
2006-12-10 15:34:04
【C语言库函数源代码】
【本程序在Dev C++ 4.9.9.2 下编译通过】
int my_iscsymf(int c)
{
return
(isalpha(c) || ( c == '_' ));
}//判断字符c是否为英文字母和下划线
int main()
{
char ch =
'a';
if(my_iscsymf(ch))
printf("%c is English or UnderLine
Character! \n",ch);
else
printf("%c is not a English and
UnderLine Character!\n",ch);
ch = '_';
if(my_iscsymf(ch))
printf("%c is English or UnderLine
Character! \n",ch);
else
printf("%c is not a English and
UnderLine Character!\n",ch);
ch = '1';
if(my_iscsymf(ch))
printf("%c is English or UnderLine
Character! \n",ch);
else
printf("%c is not a English and
UnderLine Character!\n",ch);
system("pause");
return 0;
}