- 1、本文档被系统程序自动判定探测到侵权嫌疑,本站暂时做下架处理。
- 2、如果您确认为侵权,可联系本站左侧在线QQ客服请求删除。我们会保证在24小时内做出处理,应急电话:400-050-0827。
- 3、此文档由网友上传,因疑似侵权的原因,本站不提供该文档下载,只提供部分内容试读。如果您是出版社/作者,看到后可认领文档,您也可以联系本站进行批量认领。
查看更多
《Linux C API_飞龙整理_20161016》.pdf
Linux C API文档
来源:/~yhf/linux_c
整理:飞龙
日期:2014 .10.16
isalnum
测试字符是否为英文或数字
相关函数
isalpha,isdigit ,islower,isupper
表头文件
#includectype.h
定义函数
int isalnum(int c)
函数说明
检查参数c是否为英文字母或阿拉伯数字,在标准c 中相当于使用“isalpha(c) || isdigit(c)”做测试。
返回值
若参数c为字母或数字,则返回TRUE,否则返回NULL(0) 。
附加说明
此为宏定义,非真正函数。
范例
/* 找出str 字符串中为英文字母或数字的字符*/
#include ctype.h
main()
{
char str[]=”123c@#FDsP[e?”;
int i;
for (i=0;str[i]!=0;i++ )
if ( isalnum(str[i])) printf(“%c is an alphanumeric character\n”,str[i]);
}
执行
1 is an apphabetic character
2 is an apphabetic character
3 is an apphabetic character
c is an apphabetic character
F is an apphabetic character
D is an apphabetic character
s is an apphabetic character
P is an apphabetic character
e is an apphabetic character
isalpha
测试字符是否为英文字母
相关函数
isalnum,islower,isupper
表头文件
#includectype.h
定义函数
int isalpha(int c)
函数说明
检查参数c是否为英文字母,在标准c 中相当于使用“isupper(c)||islower(c)”做测试。
返回值
若参数c为英文字母,则返回TRUE,否则返回NULL(0) 。
附加说明
此为宏定义,非真正函数。
范例
/* 找出str 字符串中为英文字母的字符*/
#include ctype.h
main()
{
char str[]=”123c@#FDsP[e?”;
int i;
for (i=0;str[i]!=0;i++)
if(isalpha(str[i])) printf(“%c is an alphanumeric character\n”,str[i]);
}
执行
c is an apphabetic character
F is an apphabetic character
D is an apphabetic character
s is an apphabetic character
P is an apphabetic character
e is an apphabetic character
isascii
测试字符是否为ASCII 码字符
相关函数
iscntrl
表头文件
#include ctype.h
定义函数
int isascii(int c);
函数说明
检查参数c是否为ASCII码字符,也就是判断c的范围是否在0到127之间。
返回值
若参数c为ASCII码字符,则返回TRUE,否则返回NULL(0) 。
附加说明
此为宏定义,非真正函数。
范例
/* 判断int i是否具有对映的ASCII码字符*/
#includectype.h
main()
{
int i;
for(i=125;i130;i++)
if(isascii(i))
printf(%d is an ascii character:%c\n,i,i);
else
printf(%d is not an ascii character\n,i);
}
执行
125 is an ascii character:}
126 is an ascii character:~
127 is an ascii character:
128 is not an ascii character
您可能关注的文档
- 《Learning Recommender Systems with Adaptive Regularization》.pdf
- 《Learning through research - An Introduction To the Main Theory of Learning》.pdf
- 《LearnSmart-project-management》.pdf
- 《Lect_26_paper_ihr03》.pdf
- 《LED商业照明室内案例赏析》.pdf
- 《LED封装的一次光学系统优化设计》.pdf
- 《LED戶外照明技術》.pdf
- 《LED照明专用集成电路的设计与应用》.pdf
- 《LED照明灯项目可行性研究报告》.doc
- 《LED电子显示屏项目可行性研究报告》.pdf
- 《Linux Deepin - 深度Linux-百科 - 使用U盘安装》.pdf
- 《Linux kernel路由机制分析 》.docx
- 《linux mysql》.doc
- 《Linux shell脚本编写基础》.pdf
- 《Linux TCP Implementation》.pdf
- 《linux TCPip stack ns2 implementation》.pdf
- 《Linux 下安装mysql版本冲突问题解决》.doc
- 《Linux 入门常用命令》.doc
- 《Linux 内核子系统---内存管理子系统》.doc
- 《Linux 应用基础教程——Red Hat Enterprise Linux CentOS 5 教学课件 梁如军 Linux 应用基础教程 CH22_IPtables防火墙》.pdf
文档评论(0)