<?xml version="1.0" encoding="utf-8"?><rss version="2.0">
<channel>
<title><![CDATA[C语言编程]]></title>
<link>http://blog.pfan.cn/hcyjsj86</link>
<description>编程爱好者博客</description>
<language>zh-cn</language>
			<item>
		<title><![CDATA[c语言画蜡烛]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15889.html</link>
		<description><![CDATA[&nbsp;新3.2版QQ空间代码 　 　

&nbsp; 
#include&lt;stdlib.h&gt;#include&lt;stdio.h&gt;#include&lt;graphics.h&gt;int main(){&nbsp; int gdriver=VGA, gmode=VGAHI, i,j,size,s2,s3,s4;&nbsp; initgraph(&amp;gdriver, &amp;gmode, "c:\\tc");&nbsp; setbkcolor(BLUE);&nbsp; cleardevice();&nbsp; setcolor(12);&nbsp; setfillstyle( 4,4) ;&nbsp; bar(180,360,200,320);&nbsp;&nbsp; /*蜡烛*/&nbsp; sector(190,310,0,360,4,6);&nbsp; setcolor(6);&nbsp; getch();&nbsp; closegraph();}
&nbsp;]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 11:03:00</pubDate>
		</item>
				<item>
		<title><![CDATA[迷宫程序1.10版]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15888.html</link>
		<description><![CDATA[新3.2版QQ空间代码 　 

&nbsp; 
&nbsp; 程序目的：输入一个任意大小的迷宫，用栈求出一条走出迷宫的路径，并显示在屏幕上。程序实现：可以实现载入迷宫和保存迷宫，附带文件中有4个测试迷宫路径的文件test1~4.dd。请将这些文件拷贝到TC当前目录下，或者在载入时写明完全路径。由于屏幕大小的限制，当用户自己输入迷宫时一定要注意：迷宫大小是有限制的，不小于4*3,不大于30*20。否则会出现错误信息。输入开始时全是墙，用上下左右键移动，用Del键删除墙，形成通路，用Enter键添加墙。输入结束时可以将迷宫保存下来，以dd为扩展名。输入完毕时用F9键来得到结果，找到路径时，屏幕下方会出现Path found，否则出现Path not found。程序经Turbo C 2.0编译调试成功。运行时不用添加任何运行库。不可以在VC上编译。下载DOS版和windows版的迷宫游戏全部代码用户名：migong ----------------------------------------------------------------------------------/*MazePath Demo BY Turbo C 2.0Copyright(c) RoverUnion. All right reserved.Filename: Maze.cAuthor Dongchengyu.Ver 1.10*/#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;#include &lt;malloc.h&gt;#include &lt;conio.h&gt;#include &lt;dos.h&gt;#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#define F9 0x43#define Esc 0x1b#define Del 0x53#define Home 0x47#define End 0x4f#define Space 0x20#define Up 0x48#define Down 0x50#define Left 0x4b#define Right 0x4d#define Enter 0x0d#define F2 0x3c#define F3]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:54:00</pubDate>
		</item>
				<item>
		<title><![CDATA[关于汉诺塔问题的最终解决]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15887.html</link>
		<description><![CDATA[&nbsp;
&nbsp;&nbsp;&nbsp; 问题的提出:约19世纪末，在欧州的商店中出售一种智力玩具，在一块铜板上有三根杆，最左边的杆上自上而下、由小到大顺序串着由64个圆盘构成的塔。目的是将最左边杆上的盘全部移到右边的杆上，条件是一次只能移动一个盘，且不允许大盘放在小盘的上面。*问题分析与算法设计这是一个著名的问题，几乎所有的教材上都有这个问题。由于条件是一次只能移动一个盘，且不允许大盘放在小盘上面，所以64个盘的移动次数是：18，446，744，073，709，551，615这是一个天文数字，若每一微秒可能计算(并不输出)一次移动，那么也需要几乎一百万年。我们仅能找出问题的解决方法并解决较小N值时的汉诺塔，但很难用计算机解决64层的汉诺塔。分析问题，找出移动盘子的正确算法。首先考虑a杆下面的盘子而非杆上最上面的盘子，于是任务变成了：*将上面的63个盘子移到b杆上；*将a杆上剩下的盘子移到c杆上；*将b杆上的全部盘子移到c杆上。将这个过程继续下去，就是要先完成移动63个盘子、62个盘子、61个盘子....的工作。为了更清楚地描述算法，可以定义一个函数movedisc(n,a,b,c)。该函数的功能是：将N个盘子从A杆上借助C杆移动到B杆上。这样移动N个盘子的工作就可以按照以下过程进行：1) movedisc(n-1,a,c,b);2) 将一个盘子从a移动到b上；3) movedisc(n-1,c,b,a)；重复以上过程，直到将全部的盘子移动到位时为止。*程序与程序注释#include&lt;stdio.h&gt;void movedisc(unsigned n,char fromneedle,char toneedle,char usingneedle);int i=0;void main(){unsigned n;printf("please enter the number of disc:");scanf("%d",&amp;n); /*输入N值*/printf("\tneedle:\ta\t b\t c\n");movedisc(n,'a','c','b'); /*从A上借助B将N个盘子移动到C上*/printf("\t Total: %d\n",i);}void movedisc(unsigned n,char fromneedle,char]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:46:00</pubDate>
		</item>
				<item>
		<title><![CDATA[设计彩色框的C源程序]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15886.html</link>
		<description><![CDATA[&nbsp;
&nbsp;/*** Short driver module**/
main(){clrscr();box(1,1,23,79);box(2,2,21,77);box(3,3,19,75);box(4,4,17,73);box(5,5,15,71);box(6,6,13,69);box(7,7,11,67);box(8,8,9,65);box(9,9,7,63);box(10,10,5,61);box(11,11,3,59);box(12,12,1,57);poscur(24,1);}
/************************************************************* BOX **----------------------------------------------------------** Written by: Jeff Ebert 7/01/87 ** Modified by: xxxxxxxxxx ** ** Please modify me! ** Possible Enhancements include but are not limited to: ** 1) Variable box character styles [1 line or 2] ** 2) Error checking ** 3) Color options ** ** ** This function builds a simple double frame for a menu. ** The function is passed the parameters for the upper ** left corner row, upper left corner column the height ** of the frame and the width. ** *************************************************************/#include 
#define ULCOR 201#define URCOR 187#define LLCOR 200#define LRCOR 188#define VBAR 186#define HBAR 205#d]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:43:00</pubDate>
		</item>
				<item>
		<title><![CDATA[c语言]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15885.html</link>
		<description><![CDATA[运动与静止同时实现在这里我用圆实现运动、方块实现静止 代码如下： #include &lt;graphics.h&gt; #include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; #include &lt;conio.h&gt; int main(void) { int gdriver = DETECT, gmode; void *ball; int x, y,maxx; unsigned int size; initgraph(&amp;gdriver, &amp;gmode, ""); maxx = getmaxx(); x = 0; y = 200; rectangle(x,y+11,x+20,y+31); circle(x+10,y,10); size = imagesize(x, y-10, x+20, y+10); ball = malloc(size); setfillstyle(SOLID_FILL, BLACK); while (!kbhit()) { cleardevice(); x += 10; if (x &gt;= maxx) x = 0; rectangle(0,211,20,231); circle(x+10,y,10); delay(100); } free(ball); closegraph(); return 0; } 再来说一下赛车游戏 我上面给大家可以说是从第一步：制作简单的场景和玩家的赛车 到第二步：进一步完善场景， 大家可能已经有所领会 下面我们就把它做成一个简单的游戏 代码如下： #include &lt;math.h&gt;#include &lt;conio.h&gt; #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;graphics.h&gt; static int c=1; static int e=0; static int u=0; static int v=0; static int x=1; static int y=0; static int j=-21; static int i; static int b; void begin(void) { int xmax, ymax;]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:42:00</pubDate>
		</item>
				<item>
		<title><![CDATA[c语言(九格游戏100多行)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15884.html</link>
		<description><![CDATA[/*很多人都觉得编游戏很高深...其实不然...以下是我初学C时写个一个九格游戏涉及的知识只有函数,各种流程控制和从老师那里问来的几个非常有用的函数. 当然,当时我连一点图形的知识都没有. 我只想说明一个问题:不要觉得你C语言学得不够多,只是,你没有充分利用你所学到的*/ 
#include #include /*使用其中的int random(int a): 产生一个在0到a-1之间的整数 和 randomize():复位随机发生器*/ #include /*使用其中的gotoxy(int x,int y): 把光标移动到屏幕的x（1~80）,y（1~25/50）处*/ /*和clrscr():清屏*/ int num[]={1,2,3,4,5,6,7,8,0}; /*方块的数字*/ 
main(){ char key=0; /*键盘码*/ int pos; /*九格中，空格的位置*/ clrscr(); /*清屏*/ randomize(); /*初始化随机发生器*/ newGame(); for(;;){ key=getch(); /*获得键盘输入*/ if(key==0) continue; pos=GetTheNull(); /*得到空格*/ switch(key){ /*测试按键*/ case 72: /*按下*/ if(pos&lt;=5) change(pos,pos+3); break; case 80: /*按上*/ if(pos&gt;=3) change(pos,pos-3); break; case 77: /*按左*/ if(pos%3!=0) change(pos,pos-1); break; case 75: /*按右*/ if(pos%3!=2) change(pos,pos+1); break; case 110: /*按下‘n’新建游戏*/ newGame(); } update(); /*更新*/ if(isSuccess()){ /*看是否游戏成功*/ gotoxy(26,10); /*成功了，输出一个写有Well done!的外框*/ printf("\332\304\304\304\304\304\304\304\304\304\304\304\304\267"); gotoxy(26,11); printf("\2]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:39:00</pubDate>
		</item>
				<item>
		<title><![CDATA[c语言(可控制的笑脸)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15883.html</link>
		<description><![CDATA[纯真童趣的《泡泡堂》,还有武林情仇,笑傲江湖的《剑侠情缘online》.它是e时代常谈的话题,是交互式娱乐的主力军,是一种高层次的综合艺术,更是一个民族的文化,世界观的全新传播方式.作为游戏玩家的我们,是不是想设计一个属于自己的游戏呢?爱玩是人的天性,而C语言是我们计算机专业都要学习的一门基础学科.一般来说,是比较枯燥的.那么,我们能不能通过编一些小游戏来提高它的趣味性呢?这样学习程序设计,就不会是一件艰苦,枯燥的事,它变得象电脑游戏一样充满好奇,富有乐趣.这正是我发贴的目的. 
一、 总是从Hello,world开始 
学习编程的第一个程序,一般就是打印一个亲切的词语——"Hello,来 vcok.com 学c语言!".让我们来看看这个最简单的C程序: 
#incolude &lt;stdio.h&gt; /*把输入输出函数的头文件包含进来*/ 
int main() 
{ 
printf("Hello,来 vcok.com 学c语言!");/*在屏幕上输出字符串"Hello,来 vcok.com 学c语言!"*/ 
return 0;/*退出main函数,并返回0*/ 
} 
下面我们发现几个值得改进的地方,
1,程序的运行结果一闪而过.2,每执行这个程序一次都能看见上次运行留下的字符.3,我们还希望屏幕输出一个笑脸来欢迎我们.(大家不要小看了这个笑脸曾经有人发贴专门问呢)让我们来改进一下这个程序吧! 
1,在return语句的前面加一句:getch ();,表示按任意键结束.2,在printf语句前用clrscr函数清屏,要使用这个函数和getch函数,需要在程序开头再包含头文件conio.h.3,ASCII码也有许多非常好玩的字符,比如ASCII码值为2的就是一个笑脸,我们可以用printf("%c", 2)来输出一个笑脸. 
现在我们把Hello,world程序改成一个更好看的Hello,world了.下面让我们开始做游戏吧! 
二、 心动的开始,一个运动中的笑脸 
大家小时侯喜欢看动画片吗?哈哈,我猜你们都喜欢吧!下面就让我们来做一个小动画吧.在屏幕上显示一个运动的小笑脸,而且当它到达屏幕的边缘时会自动弹回来. 
先在程序定义一个在屏幕中运动的点的结构: 
struct move_point 
{ 
int x, y;]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:34:00</pubDate>
		</item>
				<item>
		<title><![CDATA[用C语言写的鼠标驱动程序]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15882.html</link>
		<description><![CDATA[#include &lt;dos.h&gt; #include &lt;bios.h&gt; #include &lt;malloc.h&gt; #include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; #include "graphics.h" #define R 15 /*鼠标的形态*/ void initgr(void) /* BGI初始化 */ { int gd = DETECT, gm = 0; /* 和gd = VGA,gm = VGAHI是同样效果 */ registerbgidriver(EGAVGA_driver);/* 注册BGI驱动后可以不需要.BGI文件的支持运行 */ initgraph(&amp;gd, &amp;gm, ""); } /*获取鼠标位置和按键,key=1是左键,key=2是右键*/ void getmouse(int *x,int *y,int *key) { union REGS inregs,outregs; inregs.x.ax=3; /*获取鼠标位置和状态也可以用3*/ int86(0x33,&amp;inregs,&amp;outregs); /*中断调用*/ *x=outregs.x.cx; /*cx寄存器中存的是横坐标*/ *y=outregs.x.dx; /*dx寄存器中存的是列坐标*/ *key=outregs.x.bx; /*bx寄存器是按键状态*/ } void visbilemouse() { union REGS inregs,outregs; inregs.x.ax=0x01; /*显示鼠标*/ int86(0x33,&amp;inregs,&amp;outregs); } /*按键后,返回当前鼠标的x,y和按键状态,知道按键后才返回*/ void mouse(int *x,int *y,int *z) /*画鼠标是利用将一个空矩形存入内存中,然后再在该空矩形中画鼠标形状*/ { int a=0,b=0,c=0,a_old=0,b_old=0; /*a,b的值可以随便*/ int *ball; /*定义指向内存的存储图形的指针*/ ball=malloc(imagesize(a,b,a+R,b+R)); /*返回矩形的大小*/ getimage(a,]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:30:00</pubDate>
		</item>
				<item>
		<title><![CDATA[附录一:Turbo&nbsp;C(V2.0)编译错误信息]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15881.html</link>
		<description><![CDATA[编译错误信息　　说明：Turbo C 的源程序错误分为三种类型：致命错误、一般错误和警告。其中，致命错误通常是内部编译出错；一般错误指程序的语法错误、磁盘或内存存取错误或命令行错误等；警告则只是指出一些得怀疑的情况，它并不防止编译的进行。　　下面按字母顺序A～Z分别列出致命错误及一般错误信息，英汉对照及处理方法：
(一)、致命错误英汉对照及处理方法：
Ａ－Ｂ致命错误
Bad call of in-line function (内部函数非法调用)分析与处理：在使用一个宏定义的内部函数时，没能正确调用。一个内部函数以两个下划线(__)开始和结束。
Irreducable expression tree (不可约表达式树)分析与处理：这种错误指的是文件行中的表达式太复杂，使得代码生成程序无法为它生成代码。这种表达式必须避免使用。
Register allocation failure (存储器分配失败)分析与处理：这种错误指的是文件行中的表达式太复杂，代码生成程序无法为它生成代码。此时应简化这种繁杂的表达式或干脆避免使用它。
(二)、一般错误信息英汉照及处理方法
#operator not followed by maco argument name(#运算符后没跟宏变元名)分析与处理：在宏定义中，#用于标识一宏变串。“#”号后必须跟一个宏变元名。'xxxxxx' not anargument ('xxxxxx'不是函数参数)分析与处理：在源程序中将该标识符定义为一个函数参数，但此标识符没有在函数中出现。
Ambiguous symbol 'xxxxxx' (二义性符号'xxxxxx')分析与处理：两个或多个结构的某一域名相同，但具有的偏移、类型不同。在变量或表达式中引用该域而未带结构名时，会产生二义性，此时需修改某个域名或在引用时加上结构名。
Argument # missing name (参数#名丢失)分析与处理：参数名已脱离用于定义函数的函数原型。如果函数以原型定义，该函数必须包含所有的参数名。
Argument list syntax error (参数表出现语法错误)分析与处理：函数调用的参数间必须以逗号隔开，并以一个右括号结束。若源文件中含有一个其后不是逗号也不是右括号的参数，则出错。
Array bounds missing (数组的]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:26:00</pubDate>
		</item>
				<item>
		<title><![CDATA[附录二:Turbo&nbsp;C(V2.0)使用指南]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15880.html</link>
		<description><![CDATA[（本文的许多命令或方法同样适用于TC3）
　　在开始看本文以前，我先说明一下C语言的安装和使用中最应该注意的地方：许多网友在下载Turbo C 2.0和Turbo C++ 3.0后，向我问得最多的是在使用过程中碰到如下问题：1）出现找不到 stdio.h conio.h等include文件；2）出现cos.obj无法连接之类的错误　　这些问题是由于没有设置好路径引起的，目前下载的TC2，TC3按安装分类大概有两种版本：一是通过install安装，这类应该已经设置好了路径；二是直接解压后建立TC.EXE的快捷方式，在WINDOWS下双击即可运行（DOS下直接运行TC.EXE）,目前国内大多为这种,因此下载使用前请注意路径设置：设置方法为：OPTION-&gt;DIRECTORIES:INCLUDE: [TC2/3所在目录]/includeLIB: [TC2/3所在目录]/liboutput输出目录请自己设置一个工作目录，以免混在一起。最后还提醒一点：FILES中的Change dir(改变当前目录）中应设置为当前程序所在目录。一、 Turbo C 2.0的安装和启动 　　Turbo C 2.0的安装非常简单, 只要将1#盘插入A驱动器中, 在DOS的"A&gt;" 下键入: A&gt;INSTALL 即可, 此时屏幕上显示三种选择: 1. 在硬盘上创造一个新目录来安装整个Turbo C 2.0系统。 2. 对Turbo C 1.5更新版本。这样的安装将保留原来对选择项、颜色和编辑功能键的设置。 3. 为只有两个软盘而无硬盘的系统安装Turbo C 2.0。 　　这里假定按第一种选择进行安装, 只要在安装过程中按对盘号的提示, 顺序插入各个软盘, 就可以顺利地进行安装, 安装完毕将在C盘根目录下建立一个TC 子目录, TC下还建立了两个了目录LIB和INCLUDE, LIB子目录中存放库文件, INCLUDE子目录中存放所有头文件。运行Turbo C2.0时, 只要在TC 子目录下键入TC并回车即可进入Turbo C 2. 0 集成开发环境。二、 Turbo C 2.0集成开发环境的使用 
进入Turbo C 2.0集成开发环境中后, 屏幕上显示: ──────────────────────────────　File Edit Run Compile Projec]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:24:00</pubDate>
		</item>
				<item>
		<title><![CDATA[Turbo&nbsp;C(V2.0)编译错误信息]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15879.html</link>
		<description><![CDATA[编译错误信息　　说明：Turbo C 的源程序错误分为三种类型：致命错误、一般错误和警告。其中，致命错误通常是内部编译出错；一般错误指程序的语法错误、磁盘或内存存取错误或命令行错误等；警告则只是指出一些得怀疑的情况，它并不防止编译的进行。　　下面按字母顺序A～Z分别列出致命错误及一般错误信息，英汉对照及处理方法：(一)、致命错误英汉对照及处理方法：Ａ－Ｂ致命错误Bad call of in-line function (内部函数非法调用)分析与处理：在使用一个宏定义的内部函数时，没能正确调用。一个内部函数以两个下划线(__)开始和结束。Irreducable expression tree (不可约表达式树)分析与处理：这种错误指的是文件行中的表达式太复杂，使得代码生成程序无法为它生成代码。这种表达式必须避免使用。Register allocation failure (存储器分配失败)分析与处理：这种错误指的是文件行中的表达式太复杂，代码生成程序无法为它生成代码。此时应简化这种繁杂的表达式或干脆避免使用它。(二)、一般错误信息英汉照及处理方法#operator not followed by maco argument name(#运算符后没跟宏变元名)分析与处理：在宏定义中，#用于标识一宏变串。“#”号后必须跟一个宏变元名。'xxxxxx' not anargument ('xxxxxx'不是函数参数)分析与处理：在源程序中将该标识符定义为一个函数参数，但此标识符没有在函数中出现。Ambiguous symbol 'xxxxxx' (二义性符号'xxxxxx')分析与处理：两个或多个结构的某一域名相同，但具有的偏移、类型不同。在变量或表达式中引用该域而未带结构名时，会产生二义性，此时需修改某个域名或在引用时加上结构名。Argument # missing name (参数#名丢失)分析与处理：参数名已脱离用于定义函数的函数原型。如果函数以原型定义，该函数必须包含所有的参数名。Argument list syntax error (参数表出现语法错误)分析与处理：函数调用的参数间必须以逗号隔开，并以一个右括号结束。若源文件中含有一个其后不是逗号也不是右括号的参数，则出错。Array bounds missing (数组的界限符"]"丢失)分析与处理：在源文件中定义]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:18:00</pubDate>
		</item>
				<item>
		<title><![CDATA[函数大全(a开头)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15878.html</link>
		<description><![CDATA[函数名: abort 功 能: 异常终止一个进程 用 法: void abort(void); 程序例: #include #include 
int main(void) { printf("Calling abort()\n"); abort(); return 0; /* This is never reached */ } 
函数名: abs 功 能: 求整数的绝对值 用 法: int abs(int i); 程序例: #include #include 
int main(void) { int number = -1234; 
printf("number: %d absolute value: %d\n", number, abs(number)); return 0; } 
函数名: absread, abswirte 功 能: 绝对磁盘扇区读、写数据 用 法: int absread(int drive, int nsects, int sectno, void *buffer); int abswrite(int drive, int nsects, in tsectno, void *buffer); 程序例: /* absread example */ 
#include #include #include #include 
int main(void) { int i, strt, ch_out, sector; char buf[512]; 
printf("Insert a diskette into drive A and press any key\n"); getch(); sector = 0; if (absread(0, 1, sector, &amp;buf) != 0) { perror("Disk problem"); exit(1); } printf("Read OK\n"); strt = 3; for (i=0; i&lt;80; i++) { ch_out = buf[strt+i]; putchar(ch_out); } printf("\n"); return(0); } 
函数名: access 功 能: 确定文件的访问权限 用 法: int access(const char]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:15:00</pubDate>
		</item>
				<item>
		<title><![CDATA[函数大全(b开头)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15877.html</link>
		<description><![CDATA[函数名: bar 功 能: 画一个二维条形图 用 法: void far bar(int left, int top, int right, int bottom); 程序例: 
#include #include #include #include 
int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy, i; 
/* initialize graphics and local variables */ initgraph(&amp;gdriver, &amp;gmode, ""); 
/* 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 */ } 
midx = getmaxx() / 2; midy = getmaxy() / 2; 
/* loop through the fill patterns */ for (i=SOLID_FILL; i]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:14:00</pubDate>
		</item>
				<item>
		<title><![CDATA[函数大全(c开头)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15876.html</link>
		<description><![CDATA[函数名: cabs 功 能: 计算复数的绝对值 用 法: double cabs(struct complex z); 程序例: 
#include #include 
int main(void) { struct complex z; double val; 
z.x = 2.0; z.y = 1.0; val = cabs(z); 
printf("The absolute value of %.2lfi %.2lfj is %.2lf", z.x, z.y, val); return 0; } 
函数名: calloc 功 能: 分配主存储器 用 法: void *calloc(size_t nelem, size_t elsize); 程序例: 
#include #include 
int main(void) { char *str = NULL; 
/* allocate memory for string */ str = calloc(10, sizeof(char)); 
/* copy "Hello" into string */ strcpy(str, "Hello"); 
/* display string */ printf("String is %s\n", str); 
/* free memory */ free(str); 
return 0; } 
函数名: ceil 功 能: 向上舍入 用 法: double ceil(double x); 程序例: 
#include #include 
int main(void) { double number = 123.54; double down, up; 
down = floor(number); up = ceil(number); 
printf("original number %5.2lf\n", number); printf("number rounded down %5.2lf\n", down); printf("number rounded up %5.2lf\n", up); 
return 0; } 
函数名: cgets 功 能: 从控制台读字符串 用 法: char *cgets(char *str); 程序例]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:10:00</pubDate>
		</item>
				<item>
		<title><![CDATA[函数大全(d开头)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15875.html</link>
		<description><![CDATA[函数名: delay 功 能: 将程序的执行暂停一段时间(毫秒) 用 法: void delay(unsigned milliseconds); 程序例: /* Emits a 440-Hz tone for 500 milliseconds */ #include 
int main(void) { sound(440); delay(500); nosound(); 
return 0; } 
函数名: delline 功 能: 在文本窗口中删去一行 用 法: void delline(void); 程序例: 
#include 
int main(void) { clrscr(); cprintf("The function DELLINE deletes \ the line containing the\r\n"); cprintf("cursor and moves all lines \ below it one line up.\r\n"); cprintf("DELLINE operates within the \ currently active text\r\n"); cprintf("window. Press any key to \ continue . . ."); gotoxy(1,2); /* Move the cursor to the second line and first column */ getch(); 
delline(); getch(); 
return 0; } 
函数名: detectgraph 功 能: 通过检测硬件确定图形驱动程序和模式 用 法: void far detectgraph(int far *graphdriver, int far *graphmode); 程序例: 
#include #include #include #include 
/* names of the various cards supported */ char *dname[] = { "requests detection", "a CGA", "an MCGA", "an EGA", "a 64K EGA", "a monochrome EGA", "an IBM 8514", "a H]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:09:00</pubDate>
		</item>
				<item>
		<title><![CDATA[函数大全(e开头)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15874.html</link>
		<description><![CDATA[函数名: ecvt 功 能: 把一个浮点数转换为字符串 用 法: char ecvt(double value, int ndigit, int *decpt, int *sign); 程序例: 
#include #include #include 
int main(void) { char *string; double value; int dec, sign; int ndig = 10; 
clrscr(); value = 9.876; string = ecvt(value, ndig, &amp;dec, &amp;sign); printf("string = %s dec = %d \ sign = %d\n", string, dec, sign); 
value = -123.45; ndig= 15; string = ecvt(value,ndig,&amp;dec,&amp;sign); printf("string = %s dec = %d sign = %d\n", string, dec, sign); 
value = 0.6789e5; /* scientific notation */ ndig = 5; string = ecvt(value,ndig,&amp;dec,&amp;sign); printf("string = %s dec = %d\ sign = %d\n", string, dec, sign); 
return 0; } 
函数名: ellipse 功 能: 画一椭圆 用 法: void far ellipse(int x, int y, int stangle, int endangle, int xradius, int yradius); 程序例: 
#include #include #include #include 
int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy; int stangle = 0, endangle = 360; int xradius = 100, yradius = 50; 
/* init]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:07:00</pubDate>
		</item>
				<item>
		<title><![CDATA[函数大全(f开头)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15873.html</link>
		<description><![CDATA[double fabs(double x);
返回双精度x的绝对值。

void far *farcalloc(unsigned long nunits,unsigned long unitsz);
堆中给含有nu从远nits个元素的，每个元素占用unitsz个字节长的数组分配存贮区。成功是返回指向新分配的内存块的指针；若存贮空间不够，返回NULL。
&nbsp;
unsigned long farcoreleft(void);
返回远堆中未用存贮区的大小。

void farfree(void far *block);
释放远堆中以前所分配内存块。

void far *farmalloc(unsigned long nbytes);
从远堆分配长nbytes字节的内存块，返回新地址。

void far *farrealloc(void far *oldblock,unsigned long nbytes);
调整已分配的内存块的大小为nbytes。需要的话，可把块中的内容复制到新位置。要注意：所有的可用的RAM可被分配，大于64K的块可被分配。远指针用于存取被分配的块。返回重新分配的内存块的地址。若存贮块重新分配失败，返回NULL。
struct fcb {
char fcb_drive; /* 0 = default, 1 = A, 2 = B */
char fcb_name[8]; /* File name */
char fcb_ext[3]; /* File extension */
short fcb_curblk; /* Current block number */
short fcb_recsize; /* Logical record size in bytes */
long fcb_filsize; /* File size in bytes */
short fcb_date; /* Date file was last written */
char fcb_resv[10]; /* Reserved for DOS */
char fcb_currec; /* Current record in block */
long fcb_random; /* Random recor]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:06:00</pubDate>
		</item>
				<item>
		<title><![CDATA[函数大全(g开头)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15872.html</link>
		<description><![CDATA[函数名: gcvt 功 能: 把浮点数转换成字符串 用 法: char *gcvt(double value, int ndigit, char *buf); 程序例: 
#include #include 
int main(void) { char str[25]; double num; int sig = 5; /* significant digits */ 
/* a regular number */ num = 9.876; gcvt(num, sig, str); printf("string = %s\n", str); 
/* a negative number */ num = -123.4567; gcvt(num, sig, str); printf("string = %s\n", str); 
/* scientific notation */ num = 0.678e5; gcvt(num, sig, str); printf("string = %s\n", str); 
return(0); } 
函数名: geninterrupt 功 能: 产生一个软中断 用 法: void geninterrupt(int intr_num); 程序例: 
#include #include 
/* function prototype */ void writechar(char ch); 
int main(void) { clrscr(); gotoxy(80,25); writechar('*'); getch(); return 0; } 
/* outputs a character at the current cursor position using the video BIOS to avoid the scrolling of the screen when writing to location (80,25). */ 
void writechar(char ch) { struct text_info ti; /* grab current text settings */ gettextinfo(&amp;ti); /* interrupt 0x10 sub-function 9 *]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:05:00</pubDate>
		</item>
				<item>
		<title><![CDATA[函数大全(h开头)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15871.html</link>
		<description><![CDATA[函数名: harderr 功 能: 建立一个硬件错误处理程序 用 法: 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.*/ 
#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[] = { "write protect", "unknown unit", "drive not ready", "unknown command", "data error (CRC)", "bad request", "seek error", "unknown media type", "sector not found", "printer out of paper", "write fault", "read fault", "general failure", "reserved", "reserved", "invalid disk change" }; 
error_win(char *msg) { int retval; 
cputs(msg); 
/*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; } } 
r]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:03:00</pubDate>
		</item>
				<item>
		<title><![CDATA[函数大全(i开头)]]></title>
		<link>http://blog.pfan.cn/hcyjsj86/15870.html</link>
		<description><![CDATA[函数名: imagesize 功 能: 返回保存位图像所需的字节数 用 法: unsigned far imagesize(int left, int top, int right, int bottom); 程序例: 
#include #include #include #include 
#define ARROW_SIZE 10 
void draw_arrow(int x, int y); 
int main(void) { /* request autodetection */ int gdriver = DETECT, gmode, errorcode; void *arrow; int x, y, maxx; unsigned int size; 
/* initialize graphics and local variables */ initgraph(&amp;gdriver, &amp;gmode, ""); 
/* 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 */ } 
maxx = getmaxx(); x = 0; y = getmaxy() / 2; 
/* draw the image to be grabbed */ draw_arrow(x, y); 
/* calculate the size of the image */ size = imagesize(x, y-ARROW_SIZE, x+(4*ARROW_SIZE), y+ARROW_SIZE); 
/* allocate memory to hold the image */ arrow = malloc(size); 
/* grab the image */ getimage(x, y-A]]></description>
		<author><![CDATA[hcyjsj86]]></author>
		<pubDate>2006-06-16 10:02:00</pubDate>
		</item>
		</channel>
</rss>