首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

bioskey()有关问题

2012-03-20 
bioskey()问题#includestdio.h#includebios.h#includectype.h#includestdlib.h#defineRIGHT0x01#d

bioskey()问题
#include   <stdio.h>  
#include   <bios.h>  
#include   <ctype.h>  
#include   <stdlib.h>

#define   RIGHT     0x01  
#define   LEFT       0x02  
#define   CTRL       0x04  
#define   ALT         0x08  
typedef   bool   ESC_BOOL;
int   main(void)  
{  
      int   key,   modifiers;  

      /*   function   1   returns   0   until   a   key   is   pressed   */  
      while   (bioskey(1)   ==   0);  

      /*   function   0   returns   the   key   that   is   waiting   */  
      key   =   bioskey(0);  

      /*   use   function   2   to   determine   if   shift   keys   were   used   */  
      modifiers   =   bioskey(2);  
      if   (modifiers)  
      {  
            printf( "[ ");  
            if   (modifiers   &   RIGHT)   printf( "RIGHT ");  
            if   (modifiers   &   LEFT)     printf( "LEFT ");  
            if   (modifiers   &   CTRL)     printf( "CTRL ");  
            if   (modifiers   &   ALT)       printf( "ALT ");  
            printf( "] ");  
      }  
      /*   print   out   the   character   read   */  
      if   (isalnum(key   &   0xFF))  
            printf( " '%c '\n ",   key);  
      else  
            printf( "%#02x\n ",   key);  
      return   0;  
}  

为什么总是报错说找不到bios.h   ?

[解决办法]
你用的什么编译器
编译器没有提供bios.h吧
[解决办法]
免了吧,VC++你用不了这个东西了。dos时代的东西,早淘汰了。
[解决办法]
呵呵,没有VC++的include中没有bios.h嘛,好像已经不支持了这个了

热点排行