From: comeau AT panix DOT com (Greg Comeau) Newsgroups: alt.comp.lang.learn.c-c++,comp.os.msdos.djgpp,comp.programming Subject: Re: Undertaking a programming journey Date: 16 Oct 2000 20:48:57 -0400 Organization: Comeau Computing; http://www.comeaucomputing.com Lines: 24 Message-ID: <8sg7lp$gtd$1@panix3.panix.com> References: <39EAA40B DOT 31B0CA89 AT eton DOT powernet DOT co DOT uk> <8seoli$65v$1 AT nnrp1 DOT deja DOT com> <3uJG5.4922$gX34 DOT 96534735 AT news DOT randori DOT com> NNTP-Posting-Host: panix3.panix.com X-Trace: news.panix.com 971743738 18360 166.84.0.228 (17 Oct 2000 00:48:58 GMT) X-Complaints-To: abuse AT panix DOT com NNTP-Posting-Date: 17 Oct 2000 00:48:58 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com In article <3uJG5.4922$gX34 DOT 96534735 AT news DOT randori DOT com>, Wavemaker wrote: > >"ChuckEasttom" wrote: >> Richard Heathfield wrote: >> >> > Schildt is probably the primary reason that so many C programmers >> > think fflush(stdin) is a "neat trick". >> >> Whether you or even I like it, that piece of code is a part of the C >> language. > >No, it's not. Using fflush() on the input stream envokes undefined behavior. >See "The C Programming Language" by Brian W. Kernighan and Dennis M. >Ritchie: Appendix B, section B1.1, page 242. And for why, check out http://www.comeaucomputing.com/techtalk/#flushinput - Greg -- Comeau Computing / Comeau C/C++ "so close" 4.2.44 betas NOW AVAILABLE TRY Comeau C++ ONLINE at http://www.comeaucomputing.com/tryitout Email: comeau AT comeaucomputing DOT com / WEB: http://www.comeaucomputing.com