Mail Archives: djgpp/1996/05/30/22:12:03
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 ---------------------------------
- Raw text -