getkey from keyboard/control by keyboard(c programming in Turbo c++)

 #include<stdio.h>

#include<conio.h>

#include,graphics.h>

#inlcude<dos.h>

int getkey()

{

union REGS in,out;

in.h.ah=0;

int86(22,&in,&out);

return(out.h.ah);

}

void main ()

{

            int gd=DETECT,gm,key;

            clrscr();

            initgraph(&gd,&gm,"c:\\tc\\bgi");

            key=getkey();

            printf("%d",key);

            getch();

}


Comments

Popular posts from this blog

uses of struct wordregs(ax,bx,cx,dx)(c programming in Turbo c++.

Uses of header file