




已阅读5页,还剩5页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
函数大全(T开头)函数名: tan 功 能: 正切函数 用 法: double tan(double x); 程序例: #include #include int main(void) double result, x; x = 0.5; result = tan(x); printf(The tan of %lf is %lfn, x, result); return 0; 函数名: tanh 功 能: 双曲正切函数 用 法: double tanh(double x); 程序例: #include #include int main(void) double result, x; x = 0.5; result = tanh(x); printf(The hyperbolic tangent of %lf is %lfn, x, result); return 0; 函数名: tell 功 能: 取文件指针的当前位置 用 法: long tell(int handle); 程序例: #include #include #include #include int main(void) int handle; char msg = Hello world; if (handle = open(TEST.$, O_CREAT | O_TEXT | O_APPEND) = -1) perror(Error:); return 1; write(handle, msg, strlen(msg); printf(The file pointer is at byte %ldn, tell(handle); close(handle); return 0; 函数名: textattr 功 能: 设置文本属性 用 法: void textattr(int attribute); 程序例: #include int main(void) int i; clrscr(); for (i=0; i9; i+) textattr(i + (i+1) 4); cprintf(This is a testrn); return 0; 函数名: textbackground 功 能: 选择新的文本背景颜色 用 法: void textbackground(int color); 程序例: #include int main(void) int i, j; clrscr(); for (i=0; i9; i+) for (j=0; j80; j+) cprintf(C); cprintf(rn); textcolor(i+1); textbackground(i); return 0; 函数名: textcolor 功 能: 在文本模式中选择新的字符颜色 用 法: void textcolor(int color); 程序例: #include int main(void) int i; for (i=0; i15; i+) textcolor(i); cprintf(Foreground Colorrn); return 0; 函数名: textheight 功 能: 返回以像素为单位的字符串高度 用 法: int far textheight(char far *textstring); 程序例: #include #include #include #include int main(void) /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int y = 0; int i; char msg80; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ); /* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ printf(Graphics error: %sn, grapherrormsg(errorcode); printf(Press any key to halt:); getch(); exit(1); /* terminate with an error code */ /* draw some text on the screen */ for (i=1; i11; i+) /* select the text style, direction, and size */ settextstyle(TRIPLEX_FONT, HORIZ_DIR, i); /* create a message string */ sprintf(msg, Size: %d, i); /* output the message */ outtextxy(1, y, msg); /* advance to the next text line */ y += textheight(msg); /* clean up */ getch(); closegraph(); return 0; 函数名: textmode 功 能: 将屏幕设置成文本模式 用 法: void textmode(int mode); 程序例: #include int main(void) textmode(BW40); cprintf(ABC); getch(); textmode(C40); cprintf(ABC); getch(); textmode(BW80); cprintf(ABC); getch(); textmode(C80); cprintf(ABC); getch(); textmode(MONO); cprintf(ABC); getch(); return 0; 函数名: textwidth 功 能: 返回以像素为单位的字符串宽度 用 法: int far textwidth(char far *textstring); 程序例: #include #include #include #include int main(void) /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int x = 0, y = 0; int i; char msg80; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ); /* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ printf(Graphics error: %sn, grapherrormsg(errorcode); printf(Press any key to halt:); getch(); exit(1); /* terminate with an error code */ y = getmaxy() / 2; settextjustify(LEFT_TEXT, CENTER_TEXT); for (i=1; i11; i+) /* select the text style, direction, and size */ settextstyle(TRIPLEX_FONT, HORIZ_DIR, i); /* create a message string */ sprintf(msg, Size: %d, i); /* output the message */ outtextxy(x, y, msg); /* advance to the end of the text */ x += textwidth(msg); /* clean up */ getch(); closegraph(); return 0; 函数名: time 功 能: 取一天的时间 用 法: logn time(long *tloc); 程序例: #include #include #include int main(void) time_t t; t = time(NULL); printf(The number of seconds since January 1, 1970 is %ld,t); return 0; 函数名: tmpfile 功 能: 以二进制方式打开暂存文件 用 法: FILE *tmpfile(void); 程序例: #include #include int main(void) FILE *tempfp; tempfp = tmpfile(); if (tempfp) printf(Temporary file createdn); else printf(Unable to create temporary filen); exit(1); return 0; 函数名: tmpnam 功 能: 创建一个唯一的文件名 用 法: char *tmpnam(char *sptr); 程序例: #include int main(void) char name13; tmpnam(name); printf(Temporary name: %sn, name); return 0; 函数名: tolower 功 能: 把字符转换成小写字母 用 法: int tolower(int c); 程序例: #include #include #include int main(void) int length, i; char *string = THIS IS A STRING; length = strlen(string); for (i=0; i stringi = tolower(stringi); printf(%sn,string); return 0; 函数名: toupper 功 能: 把字符转换成大写字母 用 法: int toupper(int c); 程序例: #include #include #include int main(void) int length, i; char *string = this is a string; length = strlen(string); for (i=0; i stringi = toupper(stringi); p
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025武术馆教练合同
- 2024秋四年级英语上册 Module 7 Unit 1 There is a horse in this photo说课稿 外研版(三起)
- 野生药材资源保护管理说课稿-2025-2026学年中职专业课-药事法规-药剂-医药卫生大类
- 关于态度的演讲稿
- 中医期末考试试题及答案
- 公司行政文员工作总结15篇
- 智能制造企业并购工业互联网平台建设合同
- 城市公园围墙建造与景观美化合同
- 出租车驾驶员劳动合同履行期限与续签
- 战略合作伙伴股权并购合同书
- 庆祝国庆节爱国班会内容完整课件
- 2024年贵州遵义市市直事业单位选调31人历年高频难、易点(公共基础测验共200题含答案解析)模拟试卷
- 《建筑基坑工程监测技术标准》(50497-2019)
- 康复医学科关于无效中止康复训练的制度与流程
- GB/T 13460-2016再生橡胶通用规范
- 《矩阵论》研究生教学课件
- 中国荨麻疹诊疗指南(2022版)
- 北京市统一医疗服务收费标准
- 陈明伤寒论经方加减治疗脾胃病陈明
- 简明新疆地方史赵阳
- 基础观感验收自评报告
评论
0/150
提交评论