- 1
- 0
- 约2.62万字
- 约 21页
- 2019-09-19 发布于安徽
- 举报
标准c字符和字符串
atof
语法:
?
#include stdlib.h
double atof( const char *str );
功能:将字符串str转换成一个双精度数值并返回结果。 参数str 必须以有效数字开头,但是允许以“E”或“e”除外的任意非数字字符结尾。例如:
x = atof( 42.0is_the_answer );
x的值为42.0.
相关主题: atoi() and atol().
atoi
语法:
?
#include stdlib.h
int atoi( const char *str );
功能:将字符串str转换成一个整数并返回结果。参数str 以数字开头,当函数从str 中读到非数字字符则结束转换并将结果返回。例如,
i = atoi( 512.035 );
i 的值为 512.
相关主题: atof() and atol().
atol
语法:
?
#include stdlib.h
long atol( const char *str );
功能:将字符串转换成长整型数并返回结果。函数会扫描参数str字符串,跳过前面的空格字符,直到遇上数字或正负符号才开始做转换,而再遇到非数字或字符串结束时才结束转换,并将结果返回。例如,
x = atol( 1024.0001 );
x的值为1024L.
相关主题: atof() and atoi().
isalnum
语法:
?
#include ctype.h
int isalnum( int ch );
功能:如果参数是数字或字母字符,函数返回非零值,否则返回零值。
char c;
scanf( %c, c );
if( isalnum(c) )
printf( You entered the alphanumeric character %c\n, c );
相关主题: isalpha(), iscntrl(), isdigit(), isgraph(), isprint(), ispunct(), and isspace().
isalpha
语法:
?
#include ctype.h
int isalpha( int ch );
功能:如果参数是字母字符,函数返回非零值,否则返回零值。
char c;
scanf( %c, c );
if( isalpha(c) )
printf( You entered a letter of the alphabet\n );
相关主题: isalnum(), iscntrl(), isdigit(), isgraph(), isprint(), ispunct(), and isspace().
iscntrl
语法:
?
#include ctype.h
int iscntrl( int ch );
功能:如果参数是控制字符(0和0x1F之间的字符,或者等于0x7F)函数返回非零值,否则返回零值。
相关主题: isalnum(), isalpha(), isdigit(), isgraph(), isprint(), ispunct(), and isspace().
isdigit
语法:
?
#include ctype.h
int isdigit( int ch );
功能:如果参数是0到9之间的数字字符,函数返回非零值,否则返回零值.
char c;
scanf( %c, c );
if( isdigit(c) )
printf( You entered the digit %c\n, c );
相关主题: isalnum(), isalpha(), iscntrl(), isgraph(), isprint(), ispunct(), and isspace().
isgraph
语法:
?
#include ctype.h
int isgraph( int ch );
功能:如果参数是除空格外的可打印字符(可见的字符),函数返回非零值,否则返回零值。
相关主题: isalnum(), isalpha(), iscntrl(), isdigit(), isprint(), ispunct(), and isspace().
islower
语法:
?
#include ctype.h
int islower( int
您可能关注的文档
最近下载
- 【国测德育四年级】小学四年级德育优质均衡监测模拟试卷.docx VIP
- 四年级国测德育模拟试卷一及答案.docx VIP
- 新人教PEP六年级英语上册(全册)同步练习随堂练习一课一练.pdf VIP
- 七十岁驾照换证“三力测试”题库(含答案及解析).docx VIP
- 道路交通控制技术 道路交通控制基础知识 模块一 道路交通控制基础知识.pptx VIP
- 道路交通控制技术配时与性能参数计算一课件.pptx VIP
- 美术社团活动计划.docx VIP
- 党员干部个人组织生活会个人对照(学习贯彻党的创新理论方面;加强党性锤炼方面;联系服务职工群众方面;发挥先锋模范作用方面;改作风树新风等方面)存在的问题清单及整改措施.docx VIP
- 《汉密尔顿(2020)》中英文对照剧本.pdf VIP
- API 682-2014离心泵和转子泵用轴封系统-中文版.pdf
原创力文档

文档评论(0)