网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > C/C++
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.检测活动桌面是否激活.
.C语言程序设计基础之结构.
.用VC++实现http代理.
.C语言库函数(I类字母).
.揭开木马的神秘面纱.
.精华:C++编程新手错误语录(续一).
.我的程序人生路.
.C++数据结构学习:二叉树(2).
.BCB控件制作和消息处理.
.使用 C++ Builder&nbs.
.C++数据结构学习:用栈做表达式求.
.在C程序中显示汉字.
.C/C++中命令行参数的原理.
.获取操作系统的类型和版本.
.Scheduling (调度).
.实例解析C++/CLI中的继承与枚举.
.简单的画笔.
.利用.NET语言开发自己的脚本语言.
.新一代Java技术即将出现.
.ActiveBPEL的安装和配置.

C语言库函数(K类字母)

发表日期:2008-3-8


  
函数名: kbhit
功  能: 检查当前按下的键
用  法: int kbhit(void);
程序例: 
#include <conio.h> 

int main(void)
{
   cprintf("Press any key to continue:");
   while (!kbhit()) /* do nothing */ ;
   cprintf("\r\nA key was pressed...\r\n");
   return 0;
}
 
 
  

函数名: keep
功  能: 退出并继续驻留
用  法: void keep(int status, int size);
程序例: 

/***NOTE:
   This is an interrupt service routine.  You
   can NOT compile this program with Test
   Stack Overflow turned on and get an
   executable file which will operate
   correctly.  Due to the nature of this
   function the formula used to compute
   the number of paragraphs may not
   necessarily work in all cases.  Use with
   care!  Terminate Stay Resident (TSR)
   programs are complex and no other support
   for them is provided.  Refer to the
   MS-DOS technical documentation
   for more information.  */
#include <dos.h>
/* The clock tick interrupt */
#define INTR 0x1C
/* Screen attribute (blue on grey) */
#define ATTR 0x7900 

/* redUCe heaplength and stacklength
to make a smaller program in memory */
extern unsigned _heaplen = 1024;
extern unsigned _stklen  = 512; 

void interrupt ( *oldhandler)(void); 

void interrupt handler(void)
{
   unsigned int (far *screen)[80];
   static int count; 

/* For a color screen the video memory
   is at B800:0000.  For a monochrome

   system use B000:000 */
   screen = MK_FP(0xB800,0); 

/* increase the counter and keep it
   within 0 to 9 */
   count++;
   count %= 10; 

/* put the number on the screen */
   screen[0][79] = count + '0' + ATTR; 

/* call the old interrupt handler */
   oldhandler();


int main(void)


/* get the address of the current clock
   tick interrupt */
oldhandler = getvect(INTR); 

/* install the new interrupt handler */
setvect(INTR, handler); 

/* _psp is the starting address of the
   program in memory.  The top of the stack
   is the end of the program.  Using _SS and
   _SP together we can get the end of the
   stack.  You may want to allow a bit of
   saftey space to insure that enough room
   is being allocated ie:
   (_SS + ((_SP + safety space)/16) - _psp)
*/
keep(0, (_SS + (_SP/16) - _psp));
return 0;
}
上一篇:C语言库函数(M类字母) 人气:668
下一篇:C语言库函数(S类字母) 人气:696
浏览全部C/C++的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐