Mail Archives: djgpp/1997/11/11/08:30:57
(ionicis AT geocities DOT com) writes:
> Ok, what EXACTLY does that interrupt function do? I need to know
> EXACTLY what it does when called. I'm very new to keyboard interrupts,
> so below is a little code snippet I wrote as a test program for the
> keyboard interrupt functions. I want the program to prompt the user via
> the first printf(), and then call get_key(), and when the user presses a
> key (because I assume that int6h/00h waits for the user to hit a key,
> then returns the data), and then it tells the user what key was hit.
> For some reason, the first printf() dosen't execute until the user hits
> a key. When a key is hit, both printf()s execute. Why is this? BTW,
> I'm using DJGPP.
Buffered stdout. Put \n of fflush(stdout) before you go looking for the
key, after printing "press a key".
> printf("Press a key");
printf ("Press a key\n");
-- OR --
printf ("Press a key"); fflush(stdout);
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -