Clearing the stdin buffer

Russell "Bithead" Trotter trotter at ENUXHA.EAS.ASU.EDU
Mon Jul 1 02:09:52 AEST 1991


Is there a way to clear the stdin buffer?  My main goal
is to clear out extraneous characters in the input buffer
so when I make calls to getchar() ..etc  I read from the
keyboard and not pick up unwanted chars.  I've tried
fflush(stdin) but that doesn't seem to work.  Any help
would be greatly appreciated.  Thank you.




More information about the Comp.lang.c mailing list