📄 ff.htm
字号:
<html>
<!-- #BeginTemplate "/Templates/moban2.dwt" -->
<head>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2462.0" name=GENERATOR>
<style type="text/css">
<!--
a:link{text-decoration:none}
a:hover{text-decoration:none}
a:visited{text-decoration:none}
-->
</style>
<!-- #BeginEditable "doctitle" -->
<title>TC 学习[studytc.yeah.net]</title>
<!-- #EndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" marginwidth="10" marginheight="10">
<TD align=middle> </TD>
<a href="http://abc.yesite.com/cgi-bin/abc.cgi?owner=llamaa" onClick="undefined;if(this.blur)this.blur()">
</a>
<table width="743" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td valign="top" colspan="3" height="90">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="711" height="67" valign="top">
<table width="96%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="741" height="67" valign="top">
<div align="left"><img src="../pic/studytc2.png" width="740" height="67"></div>
</td>
</tr>
</table>
</td>
<td width="30"></td>
</tr>
<tr>
<td height="23" valign="top" colspan="2">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="741" height="23">
<div align="center"><a href="../index.htm" target="_blank" onClick="undefined;if(this.blur)this.blur()"><font color="#FF0000" size="2">主页</font>
</a><font size="2">| 试卷 | <a href="http://abc.yesite.com/cgi-bin/abc.cgi?owner=llamaa" onClick="undefined;if(this.blur)this.blur()"><font color="#FF0000">留言簿</font></a>
| <a href="../download/Untitled-2.htm" onClick="undefined;if(this.blur)this.blur()"><font color="#FF0000">下载
</font></a>| <a href="mailto:lloma@sina.com" onClick="undefined;if(this.blur)this.blur()"><font color="#FF0000">给我写信</font></a>
| <font color="#FF0000">教程 | <a href="../wenti/wenti.html">问题解答</a>
| <a href="../chengxu/chengxu.html">TC编程</a>
</font></font><font color="#FF0000">| </font><font color=#ffab44 size=2><u><a class=date
onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://studytc.yeah.net');if(this.blur)this.blur()"
href="http://studytc.yeah.net/#" ><font color="#FF0000">设为首页</font></a></u></font><font color="#FF0000">
| <font size=2><a class=date title=163软件园
onClick="window.external.addFavorite('http://studytc.yeah.net','TC 学习');if(this.blur)this.blur()"
href="http://studytc.yeah.net/">加入收藏</a></font></font> </div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="1"></td>
</tr>
<tr>
<td valign="top" height="61" colspan="3">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="741" height="61"><!-- #BeginEditable "b" -->
<p> </p>
<p> </p>
<!-- #EndEditable --></td>
</tr>
</table>
</td>
<td></td>
</tr>
<tr>
<td valign="top" width="120" rowspan="4">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="120" height="602"></td>
</tr>
<tr>
<td height="1"><img height="1" width="120" src="/spacer.gif"></td>
</tr>
</table>
</td>
<td width="500" height="13"></td>
<td width="122" rowspan="3" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="122" height="500"></td>
</tr>
<tr>
<td height="1"><img height="1" width="122" src="/spacer.gif"></td>
</tr>
</table>
</td>
<td></td>
</tr>
<tr>
<td valign="top" height="9">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td width="499" height="8"></td>
</tr>
<tr>
<td height="1"><img height="1" width="500" src="/spacer.gif"></td>
</tr>
</table>
</td>
<td></td>
</tr>
<tr>
<td valign="top" rowspan="3">
<p> </p>
<p> </p>
<!-- #BeginEditable "a" -->
<p><br>
<br>
</p>
<p>函数名: fabs <br>
功 能: 返回浮点数的绝对值 <br>
用 法: double fabs(double x); <br>
程序例:
<p>#include <stdio.h> <br>
#include <math.h>
<p>int main(void) <br>
{ <br>
float number = -1234.0;
<p> printf("number: %f absolute value: %f\n", <br>
number, fabs(number)); <br>
return 0; <br>
} <br>
<br>
<br>
<p>函数名: farcalloc <br>
功 能: 从远堆栈中申请空间 <br>
用 法: void far *farcalloc(unsigned long units, unsigned ling unitsz);
<br>
程序例: <br>
#include <stdio.h> <br>
#include <alloc.h> <br>
#include <string.h> <br>
#include <dos.h>
<p>int main(void) <br>
{ <br>
char far *fptr; <br>
char *str = "Hello";
<p> /* allocate memory for the far pointer */ <br>
fptr = farcalloc(10, sizeof(char));
<p> /* copy "Hello" into allocated memory */ <br>
/* <br>
Note: movedata is used because you <br>
might be in a small data model, in <br>
which case a normal string copy routine
<br>
can not be used since it assumes the <br>
pointer size is near. <br>
*/ <br>
movedata(FP_SEG(str), FP_OFF(str), <br>
FP_SEG(fptr), FP_OFF(fptr), <br>
strlen(str));
<p> /* display string (note the F modifier) */ <br>
printf("Far string is: %Fs\n", fptr);
<p> /* free the memory */ <br>
farfree(fptr);
<p> return 0; <br>
} <br>
<br>
<br>
<p>函数名: farcoreleft <br>
功 能: 返回远堆中未作用存储区大小 <br>
用 法: long farcoreleft(void); <br>
程序例:
<p>#include <stdio.h> <br>
#include <alloc.h>
<p>int main(void) <br>
{ <br>
printf("The difference between the\ <br>
highest allocated block in the\ <br>
far\n");
<br>
printf("heap and the top of the far heap\ <br>
is: %lu bytes\n",
farcoreleft());
<p> return 0; <br>
} <br>
<br>
<br>
<p>函数名: farfree <br>
功 能: 从远堆中释放一块 <br>
用 法: void farfree(void); <br>
程序例:
<p>#include <stdio.h> <br>
#include <alloc.h> <br>
#include <string.h> <br>
#include <dos.h>
<p>int main(void) <br>
{ <br>
char far *fptr; <br>
char *str = "Hello";
<p> /* allocate memory for the far pointer */ <br>
fptr = farcalloc(10, sizeof(char));
<p> /* copy "Hello" into allocated memory */ <br>
/* <br>
Note: movedata is used because you might
be in a small data model, <br>
in which case a normal string copy routine
can't be used since it <br>
assumes the pointer size is near. <br>
*/ <br>
movedata(FP_SEG(str), FP_OFF(str), <br>
FP_SEG(fptr),
FP_OFF(fptr), <br>
strlen(str));
<p> /* display string (note the F modifier) */ <br>
printf("Far string is: %Fs\n", fptr);
<p> /* free the memory */ <br>
farfree(fptr);
<p> return 0; <br>
} <br>
<br>
<br>
<p>函数名: farmalloc <br>
功 能: 从远堆中分配存储块 <br>
用 法: void far *farmalloc(unsigned long size); <br>
程序例:
<p>#include <stdio.h> <br>
#include <alloc.h> <br>
#include <string.h> <br>
#include <dos.h>
<p>int main(void) <br>
{ <br>
char far *fptr; <br>
char *str = "Hello";
<p> /* allocate memory for the far pointer */ <br>
fptr = farmalloc(10);
<p> /* copy "Hello" into allocated memory */ <br>
/* <br>
Note: movedata is used because we might
<br>
be in a small data model, in which case
<br>
a normal string copy routine can not be
<br>
used since it assumes the pointer size
<br>
is near. <br>
*/ <br>
movedata(FP_SEG(str), FP_OFF(str), <br>
FP_SEG(fptr), FP_OFF(fptr), <br>
strlen(str));
<p> /* display string (note the F modifier) */ <br>
printf("Far string is: %Fs\n", fptr);
<p> /* free the memory */ <br>
farfree(fptr);
<p> return 0; <br>
} <br>
<br>
<br>
<p>函数名: farrealloc <br>
功 能: 调整远堆中的分配块 <br>
用 法: void far *farrealloc(void far *block, unsigned long newsize);
<br>
程序例:
<p>#include <stdio.h> <br>
#include <alloc.h>
<p>int main(void) <br>
{ <br>
char far *fptr;
<p> fptr = farmalloc(10); <br>
printf("First address: %Fp\n", fptr); <br>
fptr = farrealloc(fptr,20); <br>
printf("New address : %Fp\n", fptr); <br>
farfree(fptr); <br>
return 0; <br>
} <br>
<br>
<p>函数名: fclose <br>
功 能: 关闭一个流 <br>
用 法: int fclose(FILE *stream); <br>
程序例:
<p>#include <string.h> <br>
#include <stdio.h>
<p>int main(void) <br>
{ <br>
FILE *fp; <br>
char buf[11] = "0123456789";
<p> /* create a file containing 10 bytes */ <br>
fp = fopen("DUMMY.FIL", "w"); <br>
fwrite(&buf, strlen(buf), 1, fp);
<p> /* close the file */ <br>
fclose(fp); <br>
return 0; <br>
} <br>
<br>
<br>
<p>函数名: fcloseall <br>
功 能: 关闭打开流 <br>
用 法: int fcloseall(void); <br>
程序例:
<p>#include <stdio.h>
<p>int main(void) <br>
{ <br>
int streams_closed;
<p> /* open two streams */ <br>
fopen("DUMMY.ONE", "w"); <br>
fopen("DUMMY.TWO", "w");
<p> /* close the open streams */ <br>
streams_closed = fcloseall();
<p> if (streams_closed == EOF) <br>
/* issue an error message */ <br>
perror("Error"); <br>
else <br>
/* print result of fcloseall() function
*/ <br>
printf("%d streams were closed.\n", streams_closed);
<p> return 0; <br>
} <br>
<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -