C精典900例
附件称号:C精典900例压缩包内文件格式:可执行文件
附件来历:互联网
运行方式:Windows方式
是不是经自己验证:是
附件性质:免费
详细说明:里面都是一些基本使用的代码,很多都是DOS下的,看一下对编程有帮助。
132011
查询键盘状况的代码#includelt;stdio.hgt;
#includelt;bios.hgt;
voidmain(void)
{
unsignedintstate,old_state=0;
do{
state=_bios_keybrd(_KEYBRD_SHIFTSTATUS);
if(state!=old_state)
{
old_state=state;
if(state0x80)
printf(InsOn);
if(state0x40)
printf(CapsOn);
if(state0x20)
printf(NumLockOn);
if(state0x10)
printf(ScrollLockOn);
if(state0x08)
printf(Altpressed);
if(state0x04)
printf(Ctrlpressed);
if(state0x02)
printf(Leftshiftpressed);
if(state0x01)
printf(Rightshiftpressed);
printf(\n);
}
}while(!_bios_keybrd(_KEYBRD_READY));
}
(Attachment title: C Classic 900 Cases
The file format in the compressed package: executable file
Attachment source: Internet
Operation mode: Windows mode
Is it verified by yourself: yes
Attachment nature: free
Detailed description: There are some basic codes in it, many of them are under DOS, and it is helpful for programming.
132011
Code for querying keyboard status#includelt;stdio.hgt;
#includelt;bios.hgt;
voidmain(void)
{
unsignedintstate,old_state=0;
do{
state=_bios_keybrd(_KEYBRD_SHIFTSTATUS);
if(state!=old_state)
{
old_state=state;
if(state0x80)
printf(InsOn);
if(state0x40)
printf(CapsOn);
if(state0x20)
printf(NumLockOn);
if(state0x10)
printf(ScrollLockOn);
if(state0x08)
printf(Altpressed);
if(state0x04)
printf(Ctrlpressed);
if(state0x02)
printf(Leftshiftpressed);
if(state0x01)
printf(Rightshiftpressed);
printf(\n);
}
}while(!_bios_keybrd(_KEYBRD_READY));
})
页:
[1]