From: fredex AT fcshome DOT stoneham DOT ma DOT us Message-Id: <199605301820.OAA10359@fcshome.stoneham.ma.us> Subject: Re: fflush(stdin) : does it works ? To: dmicolet AT u-bourgogne DOT fr (Dominique Micollet) Date: Thu, 30 May 1996 14:20:22 -0400 (EDT) Cc: djgpp AT delorie DOT com In-Reply-To: <4ohpaj$i0j@tempo.univ-lyon1.fr> from "Dominique Micollet" at May 29, 96 03:09:07 pm Content-Type: text Content-Length: 1375 Thinking furiously, Dominique Micollet wrote: > > scanf("%[^\n]",One_String);fflush(stdin); >... > This works fine with many compilers (RS6000, SUN, DEC, PC) > > It looks like it does not work with DJGPP V2; > Another try shows me that the stdin is not emptied (spelling ?) at all. > > Is this a known behavior of fflush ? I am a new user of djgpp (an a old one > of C) and do not find anything aout that in the FAQ or the info. This is standard-conforming behavior of fflush(). While I can't, at the moment, cite a specific reference, the ANSI/ISO standard Does specifically state that fflush is defined for INPUT streams only. I can, if you need me to, look it up in the standad and give you the citation. Lemme know. Therefore, there is no standard-conforming way to flush stdin, and this behavior on the part of DJGPP is correct (even though not what you were hoping for!). Fred -- ------------------------------------------------------------------------------- .---- Fred Smith / Office: fred AT computrition DOT com ( /__ ,__. __ __ / __ : / 508-663-2524 / / / /__) / / /__) .+' Home: fredex AT fcshome DOT stoneham DOT ma DOT us / / (__ (___ (__(_ (___ / :__ 617-438-5471 -------------------------------- Jude 1:24,25 ---------------------------------