




全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
下面为C标准库中的一些函数:函数名: absread, abswirte 功 能: 绝对磁盘扇区读、写数据 用 法: int absread(int drive, int nsects, int sectno, void *buffer); int abswrite(int drive, int nsects, in tsectno, void *buffer); 程序例: /* absread example */ #include #include #include #include int main(void) int i, strt, ch_out, sector; char buf512; printf(Insert a diskette into drive A and press any keyn); getch(); sector = 0; if (absread(0, 1, sector, &buf) != 0) perror(Disk problem); exit(1); printf(Read OKn); strt = 3; for (i=0; i80; i+) ch_out = bufstrt+i; putchar(ch_out); printf(n); return(0); 函数名: access 功 能: 确定文件的访问权限 用 法: int access(const char *filename, int amode); 程序例: #include #include 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 #include int main(void) double result; double x = 0.5; result = acos(x); printf(The arc cosine of %lf is %lfn, x, result); return 0; 函数名: allocmem 功 能: 分配DOS存储段 用 法: int allocmem(unsigned size, unsigned *seg); 程序例: #include #include #include int main(void) unsigned int size, segp; int stat; size = 64; /* (64 x 16) = 1024 bytes */ stat = allocmem(size, &segp); if (stat = -1) printf(Allocated memory at segment: %xn, segp); else printf(Failed: maximum number of paragraphs available is %un, stat); return 0; 函数名: arc 功 能: 画一弧线 用 法: void far arc(int x, int y, int stangle, int endangle, int radius); 程序例: #include #include #include #include int main(void) /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy; int stangle = 45, endangle = 135; int radius = 100; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ); /* read result of initialization */ errorcode = graphresult(); /* an error occurred */ if (errorcode != grOk) printf(Graphics error: %sn, grapherrormsg(errorcode); printf(Press any key to halt:); getch(); exit(1); /* terminate with an error code */ midx = getmaxx() / 2; midy = getmaxy() / 2; setcolor(getmaxcolor(); /* draw arc */ arc(midx, midy, stangle, endangle, radius); /* clean up */ getch(); closegraph(); return 0; 函数名: asctime 功 能: 转换日期和时间为ASCII码 用 法: char *asctime(const struct tm *tblock); 程序例: #include #include #include int main(void) struct tm t; char str80; /* 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 Dayligh
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 防骗安全测试题及答案解析
- 2025年新能源行业国际合作与“一带一路”倡议研究报告
- 2025年节水知识竞赛试题及答案
- 淄博市安全教育培训试题及答案解析
- 2025年农业绿色发展政策支持下的农业面源污染治理技术市场趋势报告
- 2025闵行七宝镇村(合作社)、镇属公司公开招聘20人模拟试卷及答案详解(考点梳理)
- 2025贵州三都水族自治县人民医院(医共体)总院第二次招聘合同制工作人员51人考前自测高频考点模拟试题及1套参考答案详解
- 2025年新能源行业品牌建设与市场品牌忠诚度研究报告
- 2025福建省高速集团有限公司权属企业招聘若干人考前自测高频考点模拟试题及答案详解(新)
- 2025-2030工业软件云化转型过程中的客户付费意愿迁移报告
- 水库水坝施工方案范本
- 肺康复个案护理
- 人美版美术六年级上册全册教案
- GB/T 21499-2024粮油检验稻谷和糙米潜在出米率测定方法
- (版)科学道德与学风建设题库
- GB/Z 44314-2024生物技术生物样本保藏动物生物样本保藏要求
- 2023年全国职业院校技能大赛-融媒体内容策划与制作赛项规程
- 《电力建设施工企业安全生产标准化实施规范》
- 糖尿病周围神经病变知多少课件
- 儿童肺炎支原体肺炎诊疗指南(2023年版)解读
- 个人履职考核情况表
评论
0/150
提交评论