




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、函数大全(t开头)函数名: tan 功 能: 正切函数 用 法: double tan(double x); 程序例: #include <stdio.h> #include <math.h> int main(void) double result, x; &
2、#160;x = 0.5; result = tan(x); printf("The tan of %lf is %lfn", x, result); return 0; 函数名: tanh
3、 功 能: 双曲正切函数 用 法: double tanh(double x); 程序例: #include <stdio.h> #include <math.h> int main(void) double result, x; x = 0.5;
4、160; result = tanh(x); printf("The hyperbolic tangent of %lf is %lfn", x, result); return 0; 函数名: t
5、ell 功 能: 取文件指针的当前位置 用 法: long tell(int handle); 程序例: #include <string.h> #include <stdio.h> #include <fcntl.h> #include <io.h> int main(void)
6、 int handle; char msg = "Hello world" if (handle = open("TEST.$", O_CREAT | O_TEXT | O_APPEND) = -1)
7、160; perror("Error:"); return 1; write(handle, msg, strlen(msg); printf("The file pointer is at byte %ldn&qu
8、ot;, tell(handle); close(handle); return 0; 函数名: textattr 功 能: 设置文本属性 用 法: void textattr(int attribute); 程序例:
9、60; #include <conio.h> int main(void) int i; clrscr(); for (i=0; i<9; i+) textattr(i + (i+1)&
10、#160;<< 4); cprintf("This is a testrn"); return 0; 函数名: textbackground 功 能: 选择新的文本背
11、景颜色 用 法: void textbackground(int color); 程序例: #include <conio.h> int main(void) int i, j; clrscr(); for (i=0; i<9; i+)
12、160; for (j=0; j<80; j+) cprintf("C"); cprintf("rn");
13、0; textcolor(i+1); textbackground(i); return 0; 函数名: textcolor 功 能: 在文本模式中选择新的字符颜色 用 法: void
14、 textcolor(int color); 程序例: #include <conio.h> int main(void) int i; for (i=0; i<15; i+) textcolor(i);
15、60; cprintf("Foreground Colorrn"); return 0; 函数名: textheight 功 能: 返回以像素为单位的字符串高度 用 法: in
16、t far textheight(char far *textstring); 程序例: #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> int main(void) /* request aut
17、o detection */ int gdriver = DETECT, gmode, errorcode; int y = 0; int i; char msg80; /* initialize graphics
18、60;and local variables */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult(); if
19、160;(errorcode != grOk) /* an error occurred */ printf("Graphics error: %sn", grapherrormsg(errorcode); printf("Press
20、60;any key to halt:"); getch(); exit(1); /* terminate with an error code */ /* draw some text
21、0;on the screen */ for (i=1; i<11; i+) /* select the text style, direction, and size */ settex
22、tstyle(TRIPLEX_FONT, HORIZ_DIR, i); /* create a message string */ sprintf(msg, "Size: %d", i); /* output
23、;the message */ outtextxy(1, y, msg); /* advance to the next text line */ y += textheight(msg); &
24、#160; /* clean up */ getch(); closegraph(); return 0; 函数名: textmode 功 能: 将屏幕设置成文本模式 用
25、160;法: void textmode(int mode); 程序例: #include <conio.h> int main(void) textmode(BW40); cprintf("ABC"); getch(); textmode(C40);
26、; cprintf("ABC"); getch(); textmode(BW80); cprintf("ABC"); getch(); textmode(C80); cprintf("ABC");
27、0; getch(); textmode(MONO); cprintf("ABC"); getch(); return 0; 函数名: textwidth 功 能: 返回以像素为单位的字符串宽度 用 法
28、: int far textwidth(char far *textstring); 程序例: #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> int main(void) /* request&
29、#160;auto detection */ int gdriver = DETECT, gmode, errorcode; int x = 0, y = 0; int i; char msg80; /*
30、60;initialize graphics and local variables */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult()
31、; if (errorcode != grOk) /* an error occurred */ printf("Graphics error: %sn", grapherrormsg(errorcode);
32、60; printf("Press any key to halt:"); getch(); exit(1); /* terminate with an error code */ y
33、;= getmaxy() / 2; settextjustify(LEFT_TEXT, CENTER_TEXT); for (i=1; i<11; i+) /* select the text style, direction, an
34、d size */ settextstyle(TRIPLEX_FONT, HORIZ_DIR, i); /* create a message string */ sprintf(msg, "Size: %d",
35、60;i); /* output the message */ outtextxy(x, y, msg); /* advance to the end of the text */ &
36、#160; x += textwidth(msg); /* clean up */ getch(); closegraph(); return 0; 函数名: ti
37、me 功 能: 取一天的时间 用 法: logn time(long *tloc); 程序例: #include <time.h> #include <stdio.h> #include <dos.h> int main(void) time_t t;
38、60; t = time(NULL); printf("The number of seconds since January 1, 1970 is %ld",t); return 0; 函数名: tmpfile 功
39、 能: 以二进制方式打开暂存文件 用 法: FILE *tmpfile(void); 程序例: #include <stdio.h> #include <process.h> int main(void) FILE *tempfp; tempfp = tmpfile();
40、 if (tempfp) printf("Temporary file createdn"); else printf("Unable to create temporary filen"
41、); exit(1); return 0; 函数名: tmpnam 功 能: 创建一个唯一的文件名 用 法: char *tmpnam(char *sptr); 程序例:
42、160; #include <stdio.h> int main(void) char name13; tmpnam(name); printf("Temporary name: %sn", name); return 0; &
43、#160; 函数名: tolower 功 能: 把字符转换成小写字母 用 法: int tolower(int c); 程序例: #include <string.h> #include <stdio.h> #include <ctype.h> int main(void)
44、60; int length, i; char *string = "THIS IS A STRING" length = strlen(string); for (i=0; i<length; i+) stringi = tolower(stringi); printf("%sn
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年纺织品检验员考试解析与展望试题及答案
- 国际美术设计师行业动态与试题及答案
- 大学马原期末试题及答案
- 2024年纺织行业专业水平考试试题及答案
- 干部廉洁自律试题及答案
- 当前市场下的纺织品设计师考试试题及答案
- 2024年技术标准改革对纺织的影响试题及答案
- 商标法的试题及答案
- 公务写作考试题及答案
- 提升审美能力2024年国际商业美术设计师考试试题及答案
- 2024年宿迁市融媒体中心招聘考试真题
- 财务会计考试试题及答案
- 架桥机安拆安全监理细则
- 部编版八年级历史下册-第16课 独立自主的和平外交(教学设计4)
- 7.1 自由平等的真谛 课件- 2024-2025学年八年级道德与法治下册 统编版
- 2025年内蒙古中煤蒙大新能源化工有限公司招聘笔试参考题库附带答案详解
- 插画版权授权协议书
- 安装钢结构平台合同协议
- 地理西亚+课件-2024-2025学年七年级地理下册人教版
- 放射科质量管理制度
- 科研助理笔试题库及答案
评论
0/150
提交评论