?? t.htm
字號:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body bgcolor="#00FFFF" text="#000080">
<PRE><font size="5"><a href="a.htm">A</a> <a href="b.htm">B</a> <a href="c.htm">C</a> <a href="d.htm">D</a> <a href="e.htm">E</a> <a href="f.htm">F</a> <a href="g.htm">G</a> <a href="h.htm">H</a> <a href="i.htm">I</a> <a href="k.htm">K</a> <a href="l.htm">L</a> <a href="m.htm">M</a> <a href="n.htm">N</a> <a href="o.htm">O</a> <a href="p.htm">P</a> <a href="q.htm">Q</a> <a href="r.htm">R</a> <a href="s.htm">S</a> <a href="t.htm">T</a> <a href="u.htm">U</a> <a href="v.htm">V</a> <a href="w.htm">W</a> </font></PRE>
<PRE> </PRE>
<PRE>函數(shù)大全(t開頭)
</PRE>
<PRE>函數(shù)名: <font size="5" color="#FF0000">tan </font>
功 能: 正切函數(shù)
用 法: double tan(double x);
程序例: </PRE>
<PRE>#include
#include </PRE>
<PRE>int main(void)
{
double result, x; </PRE>
<PRE>x = 0.5;
result = tan(x);
printf("The tan of %lf is %lf\n", x, result);
return 0;
}
</PRE>
<PRE>函數(shù)名: <font size="5" color="#FF0000">tanh </font>
功 能: 雙曲正切函數(shù)
用 法: double tanh(double x);
程序例: </PRE>
<PRE>#include
#include </PRE>
<PRE>int main(void)
{
double result, x; </PRE>
<PRE>x = 0.5;
result = tanh(x);
printf("The hyperbolic tangent of %lf is %lf\n", x, result);
return 0;
}
</PRE>
<PRE>函數(shù)名:<font size="5" color="#FF0000"> tell </font>
功 能: 取文件指針的當前位置
用 法: long tell(int handle);
程序例: </PRE>
<PRE>#include
#include
#include
#include </PRE>
<PRE>int main(void)
{
int handle;
char msg[] = "Hello world"; </PRE>
<PRE>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 %ld\n", tell(handle));
close(handle);
return 0;
}
</PRE>
<PRE>函數(shù)名: <font size="5" color="#FF0000">textattr </font>
功 能: 設置文本屬性
用 法: void textattr(int attribute);
程序例: </PRE>
<PRE>#include </PRE>
<PRE>int main(void)
{
int i; </PRE>
<PRE>clrscr();
for (i=0; i<9; i++)
{
textattr(i + ((i+1) << 4));
cprintf("This is a test\r\n");
} </PRE>
<PRE>return 0;
}
</PRE>
<PRE>函數(shù)名: <font size="5" color="#FF0000">textbackground </font>
功 能: 選擇新的文本背景顏色
用 法: void textbackground(int color);
程序例: </PRE>
<PRE>#include </PRE>
<PRE>int main(void)
{
int i, j; </PRE>
<PRE>clrscr();
for (i=0; i<9; i++)
{
for (j=0; j<80; j++)
cprintf("C");
cprintf("\r\n");
textcolor(i+1);
textbackground(i);
} </PRE>
<PRE>return 0;
}
</PRE>
<PRE>函數(shù)名:<font size="5" color="#FF0000"> textcolor </font>
功 能: 在文本模式中選擇新的字符顏色
用 法: void textcolor(int color);
程序例:
#include </PRE>
<PRE>int main(void)
{
int i; </PRE>
<PRE>for (i=0; i<15; i++)
{
textcolor(i);
cprintf("Foreground Color\r\n");
} </PRE>
<PRE>return 0;
}
</PRE>
<PRE>函數(shù)名: <font size="5" color="#FF0000">textheight </font>
功 能: 返回以像素為單位的字符串高度
用 法: int far textheight(char far *textstring);
程序例: </PRE>
<PRE>#include
#include
#include
#include </PRE>
<PRE>int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int y = 0;
int i;
char msg[80]; </PRE>
<PRE>/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, ""); </PRE>
<PRE>/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
} </PRE>
<PRE>/* draw some text on the screen */
for (i=1; i<11; i++)
{
/* select the text style, direction, and size */
settextstyle(TRIPLEX_FONT, HORIZ_DIR, i); </PRE>
<PRE>/* create a message string */
sprintf(msg, "Size: %d", i); </PRE>
<PRE>/* output the message */
outtextxy(1, y, msg); </PRE>
<PRE>/* advance to the next text line */
y += textheight(msg);
} </PRE>
<PRE>/* clean up */
getch();
closegraph();
return 0;
}
</PRE>
<PRE>函數(shù)名: <font size="5" color="#FF0000">textmode </font>
功 能: 將屏幕設置成文本模式
用 法: void textmode(int mode);
程序例: </PRE>
<PRE>#include </PRE>
<PRE>int main(void)
{
textmode(BW40);
cprintf("ABC");
getch(); </PRE>
<PRE>textmode(C40);
cprintf("ABC");
getch(); </PRE>
<PRE>textmode(BW80);
cprintf("ABC");
getch(); </PRE>
<PRE>textmode(C80);
cprintf("ABC");
getch(); </PRE>
<PRE>textmode(MONO);
cprintf("ABC");
getch(); </PRE>
<PRE>return 0;
}
</PRE>
<PRE>函數(shù)名: <font size="5" color="#FF0000">textwidth </font>
功 能: 返回以像素為單位的字符串寬度
用 法: int far textwidth(char far *textstring);
程序例: </PRE>
<PRE>#include
#include
#include
#include </PRE>
<PRE>int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int x = 0, y = 0;
int i;
char msg[80]; </PRE>
<PRE>/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, ""); </PRE>
<PRE>/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
} </PRE>
<PRE>y = getmaxy() / 2; </PRE>
<PRE>settextjustify(LEFT_TEXT, CENTER_TEXT);
for (i=1; i<11; i++)
{
/* select the text style, direction, and size */
settextstyle(TRIPLEX_FONT, HORIZ_DIR, i); </PRE>
<PRE>/* create a message string */
sprintf(msg, "Size: %d", i); </PRE>
<PRE>/* output the message */
outtextxy(x, y, msg); </PRE>
<PRE>/* advance to the end of the text */
x += textwidth(msg);
} </PRE>
<PRE>/* clean up */
getch();
closegraph();
return 0;
}
</PRE>
<PRE>函數(shù)名:<font size="5" color="#FF0000"> time </font>
功 能: 取一天的時間
用 法: logn time(long *tloc);
程序例: </PRE>
<PRE>#include
#include
#include </PRE>
<PRE>int main(void)
{
time_t t; </PRE>
<PRE>t = time(NULL);
printf("The number of seconds since January 1, 1970 is %ld",t);
return 0;
}
</PRE>
<PRE>函數(shù)名:<font size="5" color="#FF0000"> tmpfile </font>
功 能: 以二進制方式打開暫存文件
用 法: FILE *tmpfile(void);
程序例: </PRE>
<PRE>#include
#include </PRE>
<PRE>int main(void)
{
FILE *tempfp; </PRE>
<PRE>tempfp = tmpfile();
if (tempfp)
printf("Temporary file created\n");
else
{
printf("Unable to create temporary file\n");
exit(1);
} </PRE>
<PRE>return 0;
}
</PRE>
<PRE>函數(shù)名:<font size="5" color="#FF0000"> tmpnam </font>
功 能: 創(chuàng)建一個唯一的文件名
用 法: char *tmpnam(char *sptr);
程序例: </PRE>
<PRE>#include </PRE>
<PRE>int main(void)
{
char name[13]; </PRE>
<PRE>tmpnam(name);
printf("Temporary name: %s\n", name);
return 0;
}
</PRE>
<PRE>函數(shù)名:<font size="5" color="#FF0000"> tolower </font>
功 能: 把字符轉換成小寫字母
用 法: int tolower(int c);
程序例: </PRE>
<PRE>#include
#include
#include </PRE>
<PRE>int main(void)
{
int length, i;
char *string = "THIS IS A STRING"; </PRE>
<PRE>length = strlen(string);
for (i=0; i {
string[i] = tolower(string[i]);
}
printf("%s\n",string); </PRE>
<PRE>return 0;
}
</PRE>
<PRE>函數(shù)名: <font size="5" color="#FF0000">toupper </font>
功 能: 把字符轉換成大寫字母
用 法: int toupper(int c);
程序例: </PRE>
<PRE>#include
#include
#include </PRE>
<PRE>int main(void)
{
int length, i;
char *string = "this is a string"; </PRE>
<PRE>length = strlen(string);
for (i=0; i {
string[i] = toupper(string[i]);
} </PRE>
<PRE>printf("%s\n",string); </PRE>
<PRE>return 0;
}
</PRE>
<PRE>函數(shù)名:<font size="5" color="#FF0000"> tzset </font>
功 能: UNIX時間兼容函數(shù)
用 法: void tzset(void);
程序例: </PRE>
<PRE>#include
#include
#include </PRE>
<PRE>int main(void)
{
time_t td; </PRE>
<PRE>putenv("TZ=PST8PDT");
tzset();
time(&td);
printf("Current time = %s\n", asctime(localtime(&td)));
return 0;
}
</PRE>
<PRE><font size="5"><a href="a.htm">A</a> <a href="b.htm">B</a> <a href="c.htm">C</a> <a href="d.htm">D</a> <a href="e.htm">E</a> <a href="f.htm">F</a> <a href="g.htm">G</a> <a href="h.htm">H</a> <a href="i.htm">I</a> <a href="k.htm">K</a> <a href="l.htm">L</a> <a href="m.htm">M</a> <a href="n.htm">N</a> <a href="o.htm">O</a> <a href="p.htm">P</a> <a href="q.htm">Q</a> <a href="r.htm">R</a> <a href="s.htm">S</a> <a href="t.htm">T</a> <a href="u.htm">U</a> <a href="v.htm">V</a> <a href="w.htm">W</a> </font></PRE>
<PRE>
</PRE>
<pre>資料收集:beck Copyright 2004 張求熙, All Rights Reserved</pre>
<pre><a href="mailto:Email:qiuxi1984@126.com">Email:qiuxi1984@126.com</a> QQ:35540948 </pre>
<PRE> </PRE>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -