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

📄 h.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>函数大全(h开头)
</PRE>

<PRE>函数名:<font size="5" color="#FF0000"> harderr </font>
功 能: 建立一个硬件错误处理程序 
用 法: void harderr(int (*fptr)()); 
程序例: 
/*This program will trap disk errors and prompt 
the user for action. Try running it with no 
disk in drive A: to invoke its functions.*/ </PRE>
<PRE>#include 
#include 
#include 
#define IGNORE 0 
#define RETRY 1 
#define ABORT 2 
int buf[500]; 
/*define the error messages for trapping disk problems*/ 
static char *err_msg[] = { 
&quot;write protect&quot;, 
&quot;unknown unit&quot;, 
&quot;drive not ready&quot;, 
&quot;unknown command&quot;, 
&quot;data error (CRC)&quot;, 
&quot;bad request&quot;, 
&quot;seek error&quot;, 
&quot;unknown media type&quot;, 
&quot;sector not found&quot;, 
&quot;printer out of paper&quot;, 
&quot;write fault&quot;, 
&quot;read fault&quot;, 
&quot;general failure&quot;, 
&quot;reserved&quot;, 
&quot;reserved&quot;, 
&quot;invalid disk change&quot; 
}; </PRE>
<PRE>error_win(char *msg) 
{ 
int retval; </PRE>
<PRE>cputs(msg); </PRE>
<PRE>/*prompt for user to press a key to abort, retry, ignore*/ 
while(1) 
{ 
retval= getch(); 
if (retval == 'a' || retval == 'A') 
{ 
retval = ABORT; 
break; 
} 
if (retval == 'r' || retval == 'R') 
{ 
retval = RETRY; 
break; 
} 
if (retval == 'i' || retval == 'I') 
{ 
retval = IGNORE; 
break; 
} 
} </PRE>
<PRE>return(retval); 
} </PRE>
<PRE>/*pragma warn -par reduces warnings which occur 
due to the non use of the parameters errval, 
bp and si to the handler.*/ 
#pragma warn -par </PRE>
<PRE>int handler(int errval,int ax,int bp,int si) 
{ 
static char msg[80]; 
unsigned di; 
int drive; 
int errorno; 
di= _DI; 
/*if this is not a disk error then it was 
another device having trouble*/ </PRE>
<PRE>if (ax &lt; 0) 
{ 
/* report the error */ 
error_win(&quot;Device error&quot;); 
/* and return to the program directly requesting abort */ 
hardretn(ABORT); 
} 
/* otherwise it was a disk error */ 
drive = ax &amp; 0x00FF; 
errorno = di &amp; 0x00FF; 
/* report which error it was */ 
sprintf(msg, &quot;Error: %s on drive %c\r\nA)bort, R)etry, I)gnore: &quot;, 
err_msg[errorno], 'A' + drive); 
/* 
return to the program via dos interrupt 0x23 with abort, retry, 
or ignore as input by the user. 
*/ 
hardresume(error_win(msg)); 
return ABORT; 
} 
#pragma warn +par </PRE>
<PRE>int main(void) 
{ 
/* 
install our handler on the hardware problem interrupt 
*/ 
harderr(handler); 
clrscr(); 
printf(&quot;Make sure there is no disk in drive A:\n&quot;); 
printf(&quot;Press any key ....\n&quot;); 
getch(); 
printf(&quot;Trying to access drive A:\n&quot;); 
printf(&quot;fopen returned %p\n&quot;,fopen(&quot;A:temp.dat&quot;, &quot;w&quot;)); 
return 0; 
} 

</PRE>
<PRE>函数名:<font size="5" color="#FF0000"> hardresume </font>
功 能: 硬件错误处理函数 
用 法: void hardresume(int rescode); 
程序例: 
</PRE>
<PRE>/* This program will trap disk errors and prompt the user for action. */ 
/* Try running it with no disk in drive A: to invoke its functions */ </PRE>
<PRE>#include 
#include 
#include </PRE>
<PRE>#define IGNORE 0 
#define RETRY 1 
#define ABORT 2 </PRE>
<PRE>int buf[500]; </PRE>
<PRE>/* define the error messages for trapping disk problems */ 
static char *err_msg[] = { 
&quot;write protect&quot;, 
&quot;unknown unit&quot;, 
&quot;drive not ready&quot;, 
&quot;unknown command&quot;, 
&quot;data error (CRC)&quot;, 
&quot;bad request&quot;, 
&quot;seek error&quot;, 
&quot;unknown media type&quot;, 
&quot;sector not found&quot;, 
&quot;printer out of paper&quot;, 
&quot;write fault&quot;, 
&quot;read fault&quot;, 
&quot;general failure&quot;, 
&quot;reserved&quot;, 
&quot;reserved&quot;, 
&quot;invalid disk change&quot; 
}; </PRE>
<PRE>error_win(char *msg) 
{ 
int retval; </PRE>
<PRE>cputs(msg); </PRE>
<PRE>/* prompt for user to press a key to abort, retry, ignore */ 
while(1) 
{ 
retval= getch(); 
if (retval == 'a' || retval == 'A') 
{ 
retval = ABORT; 
break; 
} 
if (retval == 'r' || retval == 'R') 
{ 
retval = RETRY; 
break; 
} 
if (retval == 'i' || retval == 'I') 
{ 
retval = IGNORE; 
break; 
} 
} </PRE>
<PRE>return(retval); 
} </PRE>
<PRE>/* pragma warn -par reduces warnings which occur due to the non use */ 
/* of the parameters errval, bp and si to the handler. */ 
#pragma warn -par </PRE>
<PRE>int handler(int errval,int ax,int bp,int si) 
{ 
static char msg[80]; 
unsigned di; 
int drive; 
int errorno; </PRE>
<PRE>di= _DI; 
/* if this is not a disk error then it was another device having trouble */ </PRE>
<PRE>if (ax &lt; 0) 
{ 
/* report the error */ 
error_win(&quot;Device error&quot;); 
/* and return to the program directly 
requesting abort */ 
hardretn(ABORT); 
} 
/* otherwise it was a disk error */ 
drive = ax &amp; 0x00FF; 
errorno = di &amp; 0x00FF; 
/* report which error it was */ 
sprintf(msg, &quot;Error: %s on drive %c\r\nA)bort, R)etry, I)gnore: &quot;, 
err_msg[errorno], 'A' + drive); 
/* return to the program via dos interrupt 0x23 with abort, retry */ 
/* or ignore as input by the user. */ 
hardresume(error_win(msg)); 
return ABORT; 
} 
#pragma warn +par </PRE>
<PRE>int main(void) 
{ 
/* install our handler on the hardware problem interrupt */ 
harderr(handler); 
clrscr(); 
printf(&quot;Make sure there is no disk in drive A:\n&quot;); 
printf(&quot;Press any key ....\n&quot;); 
getch(); 
printf(&quot;Trying to access drive A:\n&quot;); 
printf(&quot;fopen returned %p\n&quot;,fopen(&quot;A:temp.dat&quot;, &quot;w&quot;)); 
return 0; 
} 

</PRE>
<PRE>函数名:<font size="5" color="#FF0000"> highvideo </font>
功 能: 选择高亮度文本字符 
用 法: void highvideo(void); 
程序例: </PRE>
<PRE>#include </PRE>
<PRE>int main(void) 
{ 
clrscr(); </PRE>
<PRE>lowvideo(); 
cprintf(&quot;Low Intensity text\r\n&quot;); 
highvideo(); 
gotoxy(1,2); 
cprintf(&quot;High Intensity Text\r\n&quot;); </PRE>
<PRE>return 0; 
} 

</PRE>
<PRE>函数名:<font size="5" color="#FF0000"> hypot </font>
功 能: 计算直角三角形的斜边长 
用 法: double hypot(double x, double y); 
程序例: </PRE>
<PRE>#include 
#include </PRE>
<PRE>int main(void) 
{ 
double result; 
double x = 3.0; 
double y = 4.0; </PRE>
<PRE>result = hypot(x, y); 
printf(&quot;The hypotenuse is: %lf\n&quot;, result); </PRE>
<PRE>return 0; 
} </PRE>
<p> </p>

<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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -