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

📄 o.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>函数大全(o开头)
</PRE>
<PRE>函数名: <font size="5" color="#FF0000">open </font>
功 能: 打开一个文件用于读或写 
用 法: int open(char *pathname, int access[, int permiss]); 
程序例: </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)) == -1) 
{ 
perror(&quot;Error:&quot;); 
return 1; 
} 
write(handle, msg, strlen(msg)); 
close(handle); 
return 0; 
} 

</PRE>
<PRE>函数名: <font size="5" color="#FF0000">outport </font>
功 能: 输出整数到硬件端口中 
用 法: void outport(int port, int value); 
程序例: </PRE>
<PRE>#include 
#include 
int main(void) 
{ 
int value = 64; 
int port = 0; </PRE>
<PRE>outportb(port, value); 
printf(&quot;Value %d sent to port number %d\n&quot;, value, port); 
return 0; 
} 

</PRE>
<PRE>函数名:<font size="5" color="#FF0000"> outportb </font>
功 能: 输出字节到硬件端口中 
用 法: void outportb(int port, char byte); 
程序例: </PRE>
<PRE>#include 
#include </PRE>
<PRE>int main(void) 
{ 
int value = 64; 
int port = 0; </PRE>
<PRE>outportb(port, value); 
printf(&quot;Value %d sent to port number %d\n&quot;, value, port); 
return 0; 
} 

</PRE>
<PRE>函数名: <font size="5" color="#FF0000">outtext </font>
功 能: 在视区显示一个字符串 
用 法: void far outtext(char far *textstring); 
程序例: </PRE>
<PRE>#include 
#include 
#include 
#include </PRE>
<PRE>int main(void) 
{ 
/* request auto detection */ 
int gdriver = DETECT, gmode, errorcode; 
int midx, midy; </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>midx = getmaxx() / 2; 
midy = getmaxy() / 2; </PRE>
<PRE>/* move the C.P. to the center of the screen */ 
moveto(midx, midy); </PRE>
<PRE>/* output text starting at the C.P. */ 
outtext(&quot;This &quot;); 
outtext(&quot;is &quot;); 
outtext(&quot;a &quot;); 
outtext(&quot;test.&quot;); </PRE>
<PRE>/* clean up */ 
getch(); 
closegraph(); 
return 0; 
} 

</PRE>
<PRE>函数名: <font size="5" color="#FF0000">outtextxy</font> 
功 能: 在指定位置显示一字符串 
用 法: void far outtextxy(int x, int y, char *textstring); 
程序例: </PRE>
<PRE>#include 
#include 
#include 
#include </PRE>
<PRE>int main(void) 
{ 
/* request auto detection */ 
int gdriver = DETECT, gmode, errorcode; 
int midx, midy; </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>midx = getmaxx() / 2; 
midy = getmaxy() / 2; </PRE>
<PRE>/* output text at the center of the screen*/ 
/* Note: the C.P. doesn't get changed.*/ 
outtextxy(midx, midy, &quot;This is a test.&quot;); </PRE>
<PRE>/* clean up */ 
getch(); 
closegraph(); 
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 + -