[comp.os.msdos.programmer] How do I unbuffer console IO under QuickC and DOS?

dinn@ug.cs.dal.ca (Michael 'Moose' Dinn) (05/16/91)

I need to unbuffer my console IO under DOS and QuickC (or any variant of C).
How do I do this?

 i.e. if there's a character waiting for me, getchar() will return it with
no waiting for a return or anything else...

Thanks...
--
 Michael Dinn, Sysop of the Moose's Swamp - Nova Scotia's largest Amiga BBS
 +1 (902) 463-0483, 3/12/24/48/96/14,400 baud * 170 Megabytes online
 Home: moose%swamp%banke1@cs.dal.ca (Amiga1000 running UUCP/BBS)
 School: mdinn@ac.dal.ca, dinn@ug.cs.dal.ca     | These are my opinions and
 Work:   01Moose@dalac.bitnet IRC-Op: Moose     | noone else's. (blame me :-)

drezac@dcsc.dla.mil (Duane L. Rezac) (05/17/91)

From article <1991May15.181314.16216@cs.dal.ca>, by dinn@ug.cs.dal.ca (Michael 'Moose' Dinn):
> 
> I need to unbuffer my console IO under DOS and QuickC (or any variant of C).
> How do I do this?
> 
>  i.e. if there's a character waiting for me, getchar() will return it with
> no waiting for a return or anything else...
> 
> Thanks...
> --
>  Michael Dinn, Sysop of the Moose's Swamp - Nova Scotia's largest Amiga BBS

for unbuffered IO in QuickC use getch() - It has worked well for me. 

( my most recent use was to flush the key buffer after detecting a
key hit.   to flush the buffer , I used :   while(kbhit()) getch();




--
Verse of the Hour:
For they that are such serve not our Lord Jesus Christ, but their own
belly; and by good words and fair speeches deceive the hearts of the 
simple.
    Rom. 16:17
-- 
+-----------------------+---------------------------------------------------+
| Duane L. Rezac |These views are my own, and NOT representitive of my place|
| dsacg1!dcscg1!drezac    drezac@dcscg1.dcsc.dla.mil      of Employment.    |
+-----------------------+---------------------------------------------------+