




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、函數(shù)大全(t開頭)函數(shù)名: tan 功 能: 正切函數(shù) 用 法: 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; 函數(shù)名: tanh
3、 功 能: 雙曲正切函數(shù) 用 法: 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; 函數(shù)名: t
5、ell 功 能: 取文件指針的當(dāng)前位置 用 法: 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; 函數(shù)名: textattr 功 能: 設(shè)置文本屬性 用 法: 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; 函數(shù)名: 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; 函數(shù)名: 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; 函數(shù)名: 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; 函數(shù)名: textmode 功 能: 將屏幕設(shè)置成文本模式 用
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; 函數(shù)名: 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; 函數(shù)名: ti
37、me 功 能: 取一天的時(shí)間 用 法: 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; 函數(shù)名: tmpfile 功
39、 能: 以二進(jìn)制方式打開暫存文件 用 法: 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; 函數(shù)名: tmpnam 功 能: 創(chuàng)建一個(gè)唯一的文件名 用 法: 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; 函數(shù)名: tolower 功 能: 把字符轉(zhuǎn)換成小寫字母 用 法: 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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 保安人員技術(shù)素養(yǎng)提升的路徑計(jì)劃
- 公共服務(wù)行業(yè)的品牌工作計(jì)劃
- 苗圃未來(lái)希望助力孩子成長(zhǎng)計(jì)劃
- 加強(qiáng)跨國(guó)經(jīng)營(yíng)管理提升全球競(jìng)爭(zhēng)力計(jì)劃
- 弘揚(yáng)學(xué)生尊重勞動(dòng)的精神計(jì)劃
- 2025年地理信息大數(shù)據(jù)合作協(xié)議書
- 2025年中國(guó)橡膠行業(yè)市場(chǎng)運(yùn)行態(tài)勢(shì)、產(chǎn)業(yè)鏈全景及發(fā)展趨勢(shì)報(bào)告
- 七年級(jí)下冊(cè)《立方根》課件與練習(xí)
- 利用大數(shù)據(jù)分析預(yù)測(cè)用戶需求變化
- 2025年路面清潔裝備項(xiàng)目建議書
- 四新技術(shù)培訓(xùn)
- 人教版一年級(jí)數(shù)學(xué)2024版上冊(cè)期末測(cè)評(píng)(提優(yōu)卷一)(含答案)
- 浙江省杭州市2024年中考語(yǔ)文試卷(含答案)
- 碼頭安全生產(chǎn)知識(shí)培訓(xùn)
- 初中數(shù)學(xué)解《一元二次方程》100題含答案解析
- 種植二期手種植義齒II期手術(shù)護(hù)理配合流程
- 安全隱患舉報(bào)獎(jiǎng)勵(lì)制度
- 牛津書蟲系列1-6級(jí) 雙語(yǔ) 4B-03.金銀島中英對(duì)照
- 瀝青拌合站安裝專項(xiàng)施工方案
- 2024-2025學(xué)年深圳市南山區(qū)六年級(jí)數(shù)學(xué)第一學(xué)期期末學(xué)業(yè)水平測(cè)試試題含解析
- 2024-2030年中國(guó)免疫細(xì)胞存儲(chǔ)行業(yè)市場(chǎng)發(fā)展分析及競(jìng)爭(zhēng)形勢(shì)與投資戰(zhàn)略研究報(bào)告
評(píng)論
0/150
提交評(píng)論