From: Ben Pfaff Newsgroups: alt.comp.lang.learn.c-c++,comp.os.msdos.djgpp,comp.programming Subject: Re: Undertaking a programming journey Date: 16 Oct 2000 17:13:55 -0400 Organization: Michigan State University Lines: 12 Sender: blp AT pfaffben DOT user DOT msu DOT edu Message-ID: <87og0k5w18.fsf@pfaffben.user.msu.edu> References: <8scg36$gsm$1 AT nnrp1 DOT deja DOT com> <39E9CF07 DOT 785C0C0F AT eton DOT powernet DOT co DOT uk> <8scls9$kth$1 AT nnrp1 DOT deja DOT com> <39E9FAD5 DOT DE1FDAE4 AT eton DOT powernet DOT co DOT uk> <8sdrub$h7u$1 AT nnrp1 DOT deja DOT com> <39EAA40B DOT 31B0CA89 AT eton DOT powernet DOT co DOT uk> <8seoli$65v$1 AT nnrp1 DOT deja DOT com> <39EAF73E DOT ECA52E1A AT antlimited DOT com> <8sfbu7$n06$1 AT nnrp1 DOT deja DOT com> <39EB4271 DOT 85CE6874 AT antlimited DOT com> <8sfhr4$si2$1 AT nnrp1 DOT deja DOT com> NNTP-Posting-Host: pfaffben.user.msu.edu X-AUTHid: pfaffben X-Newsreader: Gnus v5.7/Emacs 20.7 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Damian Yerrick writes: > For the record, what's the "right" way to clear an input buffer? Here's one "right" way, assuming that you mean "skip input up to the end of the line": for (;;) { int c = getc (stream); if (c == '\n' || c == EOF) break; }