- 10
- 0
- 约5.05万字
- 约 61页
- 2017-12-04 发布于江西
- 举报
unix c函数大全
UNIX环境C函数大全 UNIX环境C函数大全
函数名: abort 功 能: 异常终止一个进程 用 法: void abort(void); 程序例: #include stdio.h #include stdlib.h
int main(void) { printf(Calling abort()n); abort(); return 0; /* This is never reached */ }
函数名: abs 功 能: 求整数的绝对值 用 法: int abs(int i); 程序例: #include stdio.h #include math.h
int main(void) { int number = -1234;
printf(number: %d absolute value: %dn, number, abs(number)); return 0; }
函数名: access 功 能: 确定文件的访问权限 用 法: int access(const char *filename, int amode); 程序例: #include stdio.h #include io.h
int file_exists(char *filename);
int main(void) { printf(Does NOTEXIST.FIL exist: %sn, file_exists(NOTEXISTS.FIL) ? YES : NO); return 0; }
int file_exists(char *filename) { return (access(filename, 0) == 0); }
函数名: acos 功 能: 反余弦函数 用 法: double acos(double x); 程序例: #include stdio.h #include math.h
int main(void) { double result; double x = 0.5;
result = acos(x); printf(The arc cosine of %lf is %lfn, x, result); return 0; }
函数名: asctime 功 能: 转换日期和时间为ASCII码 用 法: char *asctime(const struct tm *tblock); 程序例: #include stdio.h #include string.h #include time.h
int main(void) { struct tm t; char str[80];
/* sample loading of tm structure */
t.tm_sec = 1; /* Seconds */ t.tm_min = 30; /* Minutes */ t.tm_hour = 9; /* Hour */ t.tm_mday = 22; /* Day of the Month */ t.tm_mon = 11; /* Month */ t.tm_year = 56; /* Year - does not include century */ t.tm_wday = 4; /* Day of the week */ t.tm_yday = 0; /* Does not show in asctime */ t.tm_isdst = 0; /* Is Daylight SavTime; does not show in asctime */
/* converts structure to null terminated string */
strcpy(str, asctime(t)); printf(%sn, str);
return 0; }
?
函数名: asin 功 能: 反正弦函数 用 法: double asin(double x); 程序例: #include stdio.h #include math.h
int main(void) { double result; double x = 0.5;
result = asin(x); printf(The arc sin of %lf is %lfn, x, result); return(0); }
?
函数名: assert 功 能: 测试一个条件并可能使程序终止 用 法: void assert(int test); 程序例: #
您可能关注的文档
- spring课件之spring in action.ppt
- SQL优化工具Lecco SQL Expert For Oracle 教程.doc
- SQL数据库培训.ppt
- SQL数据库简介.doc
- SP赚钱的五种有效方法.doc
- SQL注入攻击分析及防范论文.doc
- SSH框架说明文档.doc
- sshell 中的特殊符号解释.doc
- SQS “Tutorial”.doc
- STATA数据管理.ppt
- 小区绿化施工协议书.docx
- 墙面施工协议书.docx
- 1 古诗二首(课件)--2025-2026学年统编版语文二年级下册.pptx
- (2026春新版)部编版八年级道德与法治下册《3.1《公民基本权利》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《4.3《依法履行义务》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《6.2《按劳分配为主体、多种分配方式并存》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《6.1《公有制为主体、多种所有制经济共同发展》PPT课件.pptx
- 初三教学管理交流发言稿.docx
- 小学生课外阅读总结.docx
- 餐饮门店夜经济运营的社会责任报告(夜间贡献)撰写流程试题库及答案.doc
原创力文档

文档评论(0)