⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 t.htm

📁 C语言函数库,包含所有的C语言函数
💻 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>函数大全(t开头)

</PRE>
<PRE>函数名: <font size="5" color="#FF0000">tan </font>
功 能: 正切函数 
用 法: 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(&quot;The tan of %lf is %lf\n&quot;, x, result); 
return 0; 
} 


</PRE>
<PRE>函数名: <font size="5" color="#FF0000">tanh </font>
功 能: 双曲正切函数 
用 法: 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(&quot;The hyperbolic tangent of %lf is %lf\n&quot;, x, result); 
return 0; 
} 



</PRE>
<PRE>函数名:<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[] = &quot;Hello world&quot;; </PRE>
<PRE>if ((handle = open(&quot;TEST.$$$&quot;, O_CREAT | O_TEXT | O_APPEND)) == -1) 
{ 
perror(&quot;Error:&quot;); 
return 1; 
} 
write(handle, msg, strlen(msg)); 
printf(&quot;The file pointer is at byte %ld\n&quot;, tell(handle)); 
close(handle); 
return 0; 
} 



</PRE>
<PRE>函数名: <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&lt;9; i++) 
{ 
textattr(i + ((i+1) &lt;&lt; 4)); 
cprintf(&quot;This is a test\r\n&quot;); 
} </PRE>
<PRE>return 0; 
} 


</PRE>
<PRE>函数名: <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&lt;9; i++) 
{ 
for (j=0; j&lt;80; j++) 
cprintf(&quot;C&quot;); 
cprintf(&quot;\r\n&quot;); 
textcolor(i+1); 
textbackground(i); 
} </PRE>
<PRE>return 0; 
} 


</PRE>
<PRE>函数名:<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&lt;15; i++) 
{ 
textcolor(i); 
cprintf(&quot;Foreground Color\r\n&quot;); 
} </PRE>
<PRE>return 0; 
} 


</PRE>
<PRE>函数名: <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(&amp;gdriver, &amp;gmode, &quot;&quot;); </PRE>
<PRE>/* read result of initialization */ 
errorcode = graphresult(); 
if (errorcode != grOk) /* an error occurred */ 
{ 
printf(&quot;Graphics error: %s\n&quot;, grapherrormsg(errorcode)); 
printf(&quot;Press any key to halt:&quot;); 
getch(); 
exit(1); /* terminate with an error code */ 
} </PRE>
<PRE>/* draw some text on the screen */ 
for (i=1; i&lt;11; i++) 
{ 
/* select the text style, direction, and size */ 
settextstyle(TRIPLEX_FONT, HORIZ_DIR, i); </PRE>
<PRE>/* create a message string */ 
sprintf(msg, &quot;Size: %d&quot;, 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>函数名: <font size="5" color="#FF0000">textmode </font>
功 能: 将屏幕设置成文本模式 
用 法: void textmode(int mode); 
程序例: </PRE>
<PRE>#include </PRE>
<PRE>int main(void) 
{ 
textmode(BW40); 
cprintf(&quot;ABC&quot;); 
getch(); </PRE>
<PRE>textmode(C40); 
cprintf(&quot;ABC&quot;); 
getch(); </PRE>
<PRE>textmode(BW80); 
cprintf(&quot;ABC&quot;); 
getch(); </PRE>
<PRE>textmode(C80); 
cprintf(&quot;ABC&quot;); 
getch(); </PRE>
<PRE>textmode(MONO); 
cprintf(&quot;ABC&quot;); 
getch(); </PRE>
<PRE>return 0; 
} 

</PRE>
<PRE>函数名: <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(&amp;gdriver, &amp;gmode, &quot;&quot;); </PRE>
<PRE>/* read result of initialization */ 
errorcode = graphresult(); 
if (errorcode != grOk) /* an error occurred */ 
{ 
printf(&quot;Graphics error: %s\n&quot;, grapherrormsg(errorcode)); 
printf(&quot;Press any key to halt:&quot;); 
getch(); 
exit(1); /* terminate with an error code */ 
} </PRE>
<PRE>y = getmaxy() / 2; </PRE>
<PRE>settextjustify(LEFT_TEXT, CENTER_TEXT); 
for (i=1; i&lt;11; i++) 
{ 
/* select the text style, direction, and size */ 
settextstyle(TRIPLEX_FONT, HORIZ_DIR, i); </PRE>
<PRE>/* create a message string */ 
sprintf(msg, &quot;Size: %d&quot;, 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>函数名:<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(&quot;The number of seconds since January 1, 1970 is %ld&quot;,t); 
return 0; 
} 


</PRE>
<PRE>函数名:<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(&quot;Temporary file created\n&quot;); 
else 
{ 
printf(&quot;Unable to create temporary file\n&quot;); 
exit(1); 
} </PRE>
<PRE>return 0; 
} 


</PRE>
<PRE>函数名:<font size="5" color="#FF0000"> tmpnam </font>
功 能: 创建一个唯一的文件名 
用 法: char *tmpnam(char *sptr); 
程序例: </PRE>
<PRE>#include </PRE>
<PRE>int main(void) 
{ 
char name[13]; </PRE>
<PRE>tmpnam(name); 
printf(&quot;Temporary name: %s\n&quot;, name); 
return 0; 
} 


</PRE>
<PRE>函数名:<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 = &quot;THIS IS A STRING&quot;; </PRE>
<PRE>length = strlen(string); 
for (i=0; i { 
string[i] = tolower(string[i]); 
} 
printf(&quot;%s\n&quot;,string); </PRE>
<PRE>return 0; 
} 

</PRE>
<PRE>函数名: <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 = &quot;this is a string&quot;; </PRE>
<PRE>length = strlen(string); 
for (i=0; i { 
string[i] = toupper(string[i]); 
} </PRE>
<PRE>printf(&quot;%s\n&quot;,string); </PRE>
<PRE>return 0; 
} 

</PRE>
<PRE>函数名:<font size="5" color="#FF0000"> tzset </font>
功 能: UNIX时间兼容函数 
用 法: void tzset(void); 
程序例: </PRE>
<PRE>#include 
#include 
#include </PRE>
<PRE>int main(void) 
{ 
time_t td; </PRE>
<PRE>putenv(&quot;TZ=PST8PDT&quot;); 
tzset(); 
time(&amp;td); 
printf(&quot;Current time = %s\n&quot;, asctime(localtime(&amp;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 + -