Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!mtune!akgua!emory!platt From: platt@emory.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: How do you flush the PC's keyboard? Message-ID: <2072@emory.UUCP> Date: Fri, 5-Jun-87 18:21:46 EDT Article-I.D.: emory.2072 Posted: Fri Jun 5 18:21:46 1987 Date-Received: Sun, 7-Jun-87 00:53:17 EDT References: <747@thumper.UUCP> Reply-To: platt@emory.UUCP (Dan Platt) Organization: Math & Computer Science, Emory University, Atlanta Lines: 18 In article <747@thumper.UUCP> tr@thumper.UUCP writes: > ...I want to flush the keyboard without getting input. >flush the keyboard without getting input. >I am using Lattice C. Is there a standard way of doing this with C or >Assembler? I would not expect > fflush(stdin); >to work because fflush is said to be for output buffers. Actually, I've found fflush(stdin) works quite well here. It's true that fflush is usually used for output, and isn't needed for UNIX C, but I've found that functions such as getchar() have a problem with the carriage return without flushing after getting only one character. Without the fflush(stdin) the next getchar() returns a '\n'. But then, I'm using MS C ver 4.0, but the routines are probably similarly quirky with Lattice C. Anyway, I've seen it work, and I've used it for the above problem. Hope it's a help, and I hope it works with lattice C. Dan