没有合适的资源?快使用搜索试试~ 我知道了~
首页C语言函数大全(所有函数分类)
资源详情
资源评论
资源推荐

函数简介(无实例)
作者:unknown 来源:本站收集 发布时间:2005-10-18 18:44:38 发布人:wkw
减小字体 增大字体
颜色
分类函数,所在函数库为 ctype.h
int isalpha(int ch) 若 ch 是字母('A'-'Z','a'-'z') 返回非 0 值,否则返回 0
int isalnum(int ch) 若 ch 是字母('A'-'Z','a'-'z')或数字('0'-'9') 返回非 0 值,否则返
回 0
int isascii(int ch) 若 ch 是字符(ASCII 码中的 0-127)返回非 0 值,否则返回 0
int iscntrl(int ch) 若 ch 是作废字符(0x7F)或普通控制字符(0x00-0x1F) 返回非 0 值,否
则返回 0
int isdigit(int ch) 若 ch 是数字('0'-'9')返回非 0 值,否则返回 0
int isgraph(int ch) 若 ch 是可打印字符(不含空格)(0x21-0x7E)返回非 0 值,否则返回 0
int islower(int ch) 若 ch 是小写字母('a'-'z')返回非 0 值,否则返回 0
int isprint(int ch) 若 ch 是可打印字符(含空格)(0x20-0x7E)返回非 0 值,否则返回 0
int ispunct(int ch) 若 ch 是标点字符(0x00-0x1F)返回非 0 值,否则返回 0
int isspace(int ch) 若 ch 是空格(' '),水平制表符(' '),回车符(''),走纸换行(''),
垂直制表符(''),换行符('')返回非 0 值,否则返回 0
int isupper(int ch) 若 ch 是大写字母('A'-'Z')返回非 0 值,否则返回 0
int isxdigit(int ch) 若 ch 是 16 进制数('0'-'9','A'-'F','a'-'f')返回非 0 值,否则返回 0
int tolower(int ch) 若 ch 是大写字母('A'-'Z')返回相应的小写字母('a'-'z')
int toupper(int ch) 若 ch 是小写字母('a'-'z')返回相应的大写字母('A'-'Z')
数学函数,所在函数库为 math.h、stdlib.h、string.h、float.h
int abs(int i) 返回整型参数 i 的绝对值
double cabs(struct complex znum) 返回复数 znum 的绝对值

double fabs(double x) 返回双精度参数 x 的绝对值
long labs(long n) 返回长整型参数 n 的绝对值
double exp(double x) 返回指数函数 ex 的值
double frexp(double value,int *eptr) 返回 value=x*2n 中 x 的值,n 存贮在 eptr 中
double ldexp(double value,int exp); 返回 value*2exp 的值
double log(double x) 返回 logex 的值
double log10(double x) 返回 log10x 的值
double pow(double x,double y) 返回 xy 的值
double pow10(int p) 返回 10p 的值
double sqrt(double x) 返回+√x 的值
double acos(double x) 返回 x 的反余弦 cos-1(x)值,x 为弧度
double asin(double x) 返回 x 的反正弦 sin-1(x)值,x 为弧度
double atan(double x) 返回 x 的反正切 tan-1(x)值,x 为弧度
double atan2(double y,double x) 返回 y/x 的反正切 tan-1(x)值,y 的 x 为弧度
double cos(double x) 返回 x 的余弦 cos(x)值,x 为弧度
double sin(double x) 返回 x 的正弦 sin(x)值,x 为弧度
double tan(double x) 返回 x 的正切 tan(x)值,x 为弧度
double cosh(double x) 返回 x 的双曲余弦 cosh(x)值,x 为弧度
double sinh(double x) 返回 x 的双曲正弦 sinh(x)值,x 为弧度
double tanh(double x) 返回 x 的双曲正切 tanh(x)值,x 为弧度
double hypot(double x,double y) 返回直角三角形斜边的长度(z),x 和 y 为直角边的长度,z2
=x2+y2
double ceil(double x) 返回不小于 x 的最小整数

double floor(double x) 返回不大于 x 的最大整数
void srand(unsigned seed) 初始化随机数发生器
int rand() 产生一个随机数并返回这个数
double poly(double x,int n,double c[])从参数产生一个多项式
double modf(double value,double *iptr)将双精度数 value 分解成尾数和阶
double fmod(double x,double y) 返回 x/y 的余数
double frexp(double value,int *eptr) 将双精度数 value 分成尾数和阶
double atof(char *nptr) 将字符串 nptr 转换成浮点数并返回这个浮点数
double atoi(char *nptr) 将字符串 nptr 转换成整数并返回这个整数
double atol(char *nptr) 将字符串 nptr 转换成长整数并返回这个整数
char *ecvt(double value,int ndigit,int *decpt,int *sign) 将浮点数 value 转换成字符
串并返回该字符串
char *fcvt(double value,int ndigit,int *decpt,int *sign) 将浮点数 value 转换成字符
串并返回该字符串
char *gcvt(double value,int ndigit,char *buf) 将数 value 转换成字符串并存于 buf 中,
并返回 buf 的指针
char *ultoa(unsigned long value,char *string,int radix) 将无符号整型数 value 转换
成字符串并返回该字符串,radix 为转换时所用基数
char *ltoa(long value,char *string,int radix) 将长整型数 value 转换成字符串并返回
该字符串,radix 为转换时所用基数
char *itoa(int value,char *string,int radix) 将整数 value 转换成字符串存入 string,r
adix 为转换时所用基数
double atof(char *nptr) 将字符串 nptr 转换成双精度数,并返回这个数,错误返回 0
int atoi(char *nptr) 将字符串 nptr 转换成整型数, 并返回这个数,错误返回 0
long atol(char *nptr) 将字符串 nptr 转换成长整型数,并返回这个数,错误返回 0

double strtod(char *str,char **endptr)将字符串 str 转换成双精度数,并返回这个数,
long strtol(char *str,char **endptr,int base)将字符串 str 转换成长整型数,并返回这个
数,
int matherr(struct exception *e)用户修改数学错误返回信息函数(没有必要使用)
double _matherr(_mexcep why,char *fun,double *arg1p,double *arg2p,double retval)
用户修改数学错误返回信息函数(没有必要使用)
unsigned int _clear87() 清除浮点状态字并返回原来的浮点状态
void _fpreset() 重新初使化浮点数学程序包
unsigned int _status87() 返回浮点状态字
目录函数,所在函数库为 dir.h、dos.h
int chdir(char *path) 使指定的目录 path(如:"C:\\WPS")变成当前的工作目录,成功返回 0
int findfirst(char *pathname,struct ffblk *ffblk,int attrib)查找指定的文件,成功返
回 0 pathname 为指定的目录名和文件名,如"C:\\WPS\\TXT"
ffblk 为指定的保存文件信息的一个结构,定义如下:
┏━━━━━━━━━━━━━━━━━━┓
┃struct ffblk ┃
┃{ ┃
┃ char ff_reserved[21]; /*DOS 保留字*/┃
┃ char ff_attrib; /*文件属性*/ ┃
┃ int ff_ftime; /*文件时间*/ ┃
┃ int ff_fdate; /*文件日期*/ ┃
┃ long ff_fsize; /*文件长度*/ ┃
┃ char ff_name[13]; /*文件名*/ ┃
┃} ┃
┗━━━━━━━━━━━━━━━━━━┛
attrib 为文件属性,由以下字符代表
┏━━━━━━━━━┳━━━━━━━━┓
┃FA_RDONLY 只读文件┃FA_LABEL 卷标号┃
┃FA_HIDDEN 隐藏文件┃FA_DIREC 目录 ┃
┃FA_SYSTEM 系统文件┃FA_ARCH 档案 ┃
┗━━━━━━━━━┻━━━━━━━━┛
例:
struct ffblk ff;
findfirst("*.wps",&ff,FA_RDONLY);

int findnext(struct ffblk *ffblk) 取匹配 finddirst 的文件,成功返回 0
void fumerge(char *path,char *drive,char *dir,char *name,char *ext)此函数通过盘符
drive(C:、A:等),路径 dir(\TC、\BC\LIB 等),文件名 name(TC、WPS 等),扩展名 ext(.EXE、.C
OM 等)组成一个文件名存与 path 中.
int fnsplit(char *path,char *drive,char *dir,char *name,char *ext)此函数将文件名 p
ath 分解成盘符 drive(C:、A:等),路径 dir(\TC、\BC\LIB 等),文件名 name(TC、WPS 等),扩展
名 ext(.EXE、.COM 等),并分别存入相应的变量中.
int getcurdir(int drive,char *direc) 此函数返回指定驱动器的当前工作目录名称
drive 指定的驱动器(0=当前,1=A,2=B,3=C 等)
direc 保存指定驱动器当前工作路径的变量 成功返回 0
char *getcwd(char *buf,iint n) 此函数取当前工作目录并存入 buf 中,直到 n 个字节长为为
止.错误返回 NULL
int getdisk() 取当前正在使用的驱动器,返回一个整数(0=A,1=B,2=C 等)
int setdisk(int drive) 设置要使用的驱动器 drive(0=A,1=B,2=C 等),返回可使用驱动器总
数
int mkdir(char *pathname) 建立一个新的目录 pathname,成功返回 0
int rmdir(char *pathname) 删除一个目录 pathname,成功返回 0
char *mktemp(char *template) 构造一个当前目录上没有的文件名并存于 template 中
char *searchpath(char *pathname) 利用 MSDOS 找出文件 filename 所在路径,,此函数使用 DO
S 的 PATH 变量,未找到文件返回 NULL
进程函数,所在函数库为 stdlib.h、process.h
void abort() 此函数通过调用具有出口代码 3 的_exit 写一个终止信息于 stderr,并异常终止
程序。无返回值
int exec…装入和运行其它程序
int execl( char *pathname,char *arg0,char *arg1,…,char *argn,NULL)
int execle( char *pathname,char *arg0,char *arg1,…,
char *argn,NULL,char *envp[])
剩余307页未读,继续阅读


















am32384626
- 粉丝: 5
- 资源: 16
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
安全验证
文档复制为VIP权益,开通VIP直接复制

评论0