c++functionWord文件下载.docx
- 文档编号:15731106
- 上传时间:2022-11-15
- 格式:DOCX
- 页数:28
- 大小:25.79KB
c++functionWord文件下载.docx
《c++functionWord文件下载.docx》由会员分享,可在线阅读,更多相关《c++functionWord文件下载.docx(28页珍藏版)》请在冰豆网上搜索。
intisdigit(intch)若ch是数字('
intisgraph(intch)若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否则返回0
intislower(intch)若ch是小写字母('
intisprint(intch)若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否则返回0
intispunct(intch)若ch是标点字符(0x00-0x1F)返回非0值,否则返回0
intisspace(intch)若ch是空格('
'
),水平制表符('
\t'
),回车符('
\r'
),走纸换行('
\f'
),垂直制表符('
\v'
),换行符('
\n'
),返回非0值,否则返回0
intisupper(intch)若ch是大写字母('
intisxdigit(intch)若ch是16进制数('
F'
f'
)返回非0值,否则返回0
inttolower(intch)若ch是大写字母('
)返回相应的小写字母('
)
inttoupper(intch)若ch是小写字母('
)返回相应的大写字母('
)
数学函数,所在函数库为math.h、stdlib.h、string.h、float.h
intabs(inti)返回整型参数i的绝对值
doublecabs(structcomplexznum)返回复数znum的绝对值
doublefabs(doublex)返回双精度参数x的绝对值
longlabs(longn)返回长整型参数n的绝对值
doubleexp(doublex)返回指数函数ex的值
doublefrexp(doublevalue,int*eptr)返回value=x*2n中x的值,n存贮在eptr中
doubleldexp(doublevalue,intexp);
返回value*2exp的值
doublelog(doublex)返回logex的值
doublelog10(doublex)返回log10x的值
doublepow(doublex,doubley)返回xy的值
doublepow10(intp)返回10p的值
doublesqrt(doublex)返回x的开方
doubleacos(doublex)返回x的反余弦cos-1(x)值,x为弧度
doubleasin(doublex)返回x的反正弦sin-1(x)值,x为弧度
doubleatan(doublex)返回x的反正切tan-1(x)值,x为弧度
doubleatan2(doubley,doublex)返回y/x的反正切tan-1(x)值,y的x为弧度
doublecos(doublex)返回x的余弦cos(x)值,x为弧度
doublesin(doublex)返回x的正弦sin(x)值,x为弧度
doubletan(doublex)返回x的正切tan(x)值,x为弧度
doublecosh(doublex)返回x的双曲余弦cosh(x)值,x为弧度
doublesinh(doublex)返回x的双曲正弦sinh(x)值,x为弧度
doubletanh(doublex)返回x的双曲正切tanh(x)值,x为弧度
doublehypot(doublex,doubley)返回直角三角形斜边的长度(z),x和y为直角边的长度,z2=x2+y2
doubleceil(doublex)返回不小于x的最小整数
doublefloor(doublex)返回不大于x的最大整数
voidsrand(unsignedseed)初始化随机数发生器
intrand()产生一个随机数并返回这个数
doublepoly(doublex,intn,doublec[])从参数产生一个多项式
doublemodf(doublevalue,double*iptr)将双精度数value分解成尾数和阶
doublefmod(doublex,doubley)返回x/y的余数
doublefrexp(doublevalue,int*eptr)将双精度数value分成尾数和阶
doubleatof(char*nptr)将字符串nptr转换成浮点数并返回这个浮点数
doubleatoi(char*nptr)将字符串nptr转换成整数并返回这个整数
doubleatol(char*nptr)将字符串nptr转换成长整数并返回这个整数
char*ecvt(doublevalue,intndigit,int*decpt,int*sign)
将浮点数value转换成字符串并返回该字符串
char*fcvt(doublevalue,intndigit,int*decpt,int*sign)
char*gcvt(doublevalue,intndigit,char*buf)
将数value转换成字符串并存于buf中,并返回buf的指针
char*ultoa(unsignedlongvalue,char*string,intradix)
将无符号整型数value转换成字符串并返回该字符串,radix为转换时所用基数
char*ltoa(longvalue,char*string,intradix)
将长整型数value转换成字符串并返回该字符串,radix为转换时所用基数
char*itoa(intvalue,char*string,intradix)
将整数value转换成字符串存入string,radix为转换时所用基数
doubleatof(char*nptr)将字符串nptr转换成双精度数,并返回这个数,错误返回0
intatoi(char*nptr)将字符串nptr转换成整型数,并返回这个数,错误返回0
longatol(char*nptr)将字符串nptr转换成长整型数,并返回这个数,错误返回0
doublestrtod(char*str,char**endptr)将字符串str转换成双精度数,并返回这个数,
longstrtol(char*str,char**endptr,intbase)将字符串str转换成长整型数,并返回这个数,
函数名:
strcpy
功能:
拷贝一个字符串到另一个
用法:
char*strcpy(char*destin,char*source);
程序例:
#include<
stdio.h>
string.h>
intmain(void)
{
charstring[10];
char*str1="
abcdefghi"
;
strcpy(string,str1);
printf("
%s\n"
string);
return0;
}
strcat
字符串拼接函数
char*strcat(char*destin,char*source);
chardestination[25];
char*blank="
"
*c="
C++"
*Borland="
Borland"
strcpy(destination,Borland);
strcat(destination,blank);
strcat(destination,c);
destination);
strchr
在一个串中查找给定字符的第一个匹配之处\
char*strchr(char*str,charc);
{
charstring[15];
char*ptr,c='
r'
strcpy(string,"
Thisisastring"
);
ptr=strchr(string,c);
if(ptr)
Thecharacter%cisatposition:
%d\n"
c,ptr-string);
else
Thecharacterwasnotfound\n"
}
strcmp
串比较
intstrcmp(char*str1,char*str2);
看Asic码,str1>
str2,返回值>
0;
两串相等,返回0
char*buf1="
aaa"
*buf2="
bbb"
*buf3="
ccc"
intptr;
ptr=strcmp(buf2,buf1);
if(ptr>
0)
buffer2isgreaterthanbuffer1\n"
buffer2islessthanbuffer1\n"
ptr=strcmp(buf2,buf3);
buffer2isgreaterthanbuffer3\n"
buffer2islessthanbuffer3\n"
strncmpi
将一个串中的一部分与另一个串比较,不管大小写
intstrncmpi(char*str1,char*str2,unsignedmaxlen
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- function