正在加载图片...
附录2常用库函数 功能:在字符串 string中查找指定字符c RNA: char *strstr const char *string, const char *str Set) 功能:在字符串中查找指定子字符串。 RRE: int strcmp const char *stringl, const char *string2): int stricmp( const char *stringl, const char *string2): int strncmp( const char *stringl, const char *string2, size t count int strnicmp( const char *stringl, const char *string2, size t count 功能:比较两个字符串。 stricmp()在比较时不区对大小写字母; strncmp()仅比较两 字符串的前 maxlen位; strnicmp()仅比较两字符串的前 maxlen位,且比较时不区 分大小写字母。如果两字符串相同,则返回地否则返回非0值 原型: size t strlen( const char* string) 功能:求字符串长度。 9.数学运算库函数,原型均在头文件 math. h 原型: int abs(intn) double fabs (double x) long labs (long x): 功能:求绝对值 原型: double cabs( struct complex Z) 功能:求复数的模。 原型: double sin( double); double cos (double x) double tan ( double x) double asin (double x) double acos double x) double atan (double x) double atan2(double y, double x): 功能:求三角函数和反三角函数 原型: double sinh( double); double tanh ( double x) 功能:求双曲函数。 原型: double exp( double) double log( double x) double pow( double x, double y double sqrt( double x 功能:求指数、对数、幂函数和平方根。 原型: Int max(inta,intb);附录 2 常用库函数 347 功能: 在字符串string中查找指定字符c 原型: char *strstr( const char *string, const char *strCharSet ); 功能: 在字符串中查找指定子字符串。 原型: int strcmp( const char *string1, const char *string2 ); int _stricmp( const char *string1, const char *string2 ); int strncmp( const char *string1, const char *string2, size_t count ); int _strnicmp( const char *string1, const char *string2, size_t count ); 功能: 比较两个字符串。stricmp()在比较时不区对大小写字母;strncmp()仅比较两 字符串的前maxlen位;strnicmp()仅比较两字符串的前maxlen位,且比较时不区 分大小写字母。如果两字符串相同,则返回地否则返回非0值。 原型: size_t strlen( const char *string ); 功能: 求字符串长度。 9.数学运算库函数,原型均在头文件math.h。 原型: int abs( int n ); double fabs(double x); long labs(long x); 功能: 求绝对值。 原型: double _cabs( struct _complex z ); 功能: 求复数的模。 原型: double sin(double); double cos(double x); double tan(double x); double asin(double x); double acos(double x); double atan(double x); double atan2(double y, double x); 功能: 求三角函数和反三角函数。 原型: double sinh(double); double cosh(double x); double tanh(double x); 功能: 求双曲函数。 原型: double exp(double); double log(double x); double log10(double x); double pow(double x, double y); double sqrt(double x); 功能: 求指数、对数、幂函数和平方根。 原型: int max(int a,int b);
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有