资源描述:
《C语言库函数大全》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、C语言--TC2.0库函数大全(1)发表日期:2005年7月27日编辑:admin有100位读者读过此文【字体:大中小】【双击鼠标自动滚屏显示】字符函数,所在函数库为ctype.hintisalpha(intch)若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0intisalnum(intch)若ch是字母('A'-'Z','a'-'z')或数字('0'-'9')返回非0值,否则返回0intisascii(intch)若ch是字符(ASCII码中的0-127)返回非0值,否则返回0intiscntrl(intch)若
2、ch是作废字符(0x7F)或普通控制字符(0x00-0x1F)返回非0值,否则返回0intisdigit(intch)若ch是数字('0'-'9')返回非0值,否则返回0intisgraph(intch)若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否则返回0intislower(intch)若ch是小写字母('a'-'z')返回非0值,否则返回0intisprint(intch)若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否则返回0intispunct(intch)若ch是标点字符(0x00-0x1
3、F)返回非0值,否则返回0intisspace(intch)若ch是空格(''),水平制表符('t'),回车符('r'),走纸换行('f'),垂直制表符('v'),换行符('')返回非0值,否则返回0intisupper(intch)若ch是大写字母('A'-'Z')返回非0值,否则返回0intisxdigit(intch)若ch是16进制数('0'-'9','A'-'F','a'-'f')返回非0值,否则返回0inttolower(intch)若ch是大写字母('A'-'Z')返回相应的小写字母('a'-'z')intto
4、upper(intch)若ch是小写字母('a'-'z')返回相应的大写字母('A'-'Z') 数学函数,所在函数库为math.h、stdlib.h、string.h、float.hintabs(inti)返回整型参数i的绝对值double cabs(structcomplexznum)返回复数znum的绝对值double fabs(doublex)返回双精度参数x的绝对值long labs(longn)返回长整型参数n的绝对值double exp(doublex)返回指数函数ex的值doublefrexp(doublevalue
5、,int*eptr)返回value=x*2n中x的值,n存贮在eptr中doubleldexp(doublevalue,intexp);返回value*2exp的值double log(doublex)返回logex的值doublelog10(doublex)返回log10x的值double pow(doublex,doubley)返回xy的值doublepow10(intp)返回10p的值double sqrt(doublex)返回x的开方double acos(doublex)返回x的反余弦cos-1(x)值,x为弧度doubl
6、e asin(doublex)返回x的反正弦sin-1(x)值,x为弧度double atan(doublex)返回x的反正切tan-1(x)值,x为弧度doubleatan2(doubley,doublex)返回y/x的反正切tan-1(x)值,y的x为弧度double cos(doublex)返回x的余弦cos(x)值,x为弧度double sin(doublex)返回x的正弦sin(x)值,x为弧度double tan(doublex)返回x的正切tan(x)值,x为弧度double cosh(doublex)返回x的双曲余
7、弦cosh(x)值,x为弧度double sinh(doublex)返回x的双曲正弦sinh(x)值,x为弧度double tanh(doublex)返回x的双曲正切tanh(x)值,x为弧度doublehypot(doublex,doubley)返回直角三角形斜边的长度(z),x和y为直角边的长度,z2=x2+y2double ceil(doublex)返回不小于x的最小整数doublefloor(doublex)返回不大于x的最大整数void srand(unsignedseed)初始化随机数发生器int rand()产生一
8、个随机数并返回这个数double poly(doublex,intn,doublec[])从参数产生一个多项式double modf(doublevalue,double*iptr)将双精度数value分解