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