It's not clearing the variable, it is clearing the stream known as
stdin.  If stdin is not cleared, then anything left in the stream from
previous operations can be used in the next scanf call.  In this case,
fflush should work.

Keith Jonathan Bodwell wrote:
> 
> no, I am trying to use flushall() before a scanf because if i dont have
> the flushall() it will not pause the second time i use the scanf
> flushall() is in the stdio.h file in Microsoft Visual C++ and my program
> works there, but when I try to compile it in linux, it cant find
> flushall().the flushall() is used to clear the variables, fflush is for
> flushing file stream I beleave.
> 
> Aaron Konstam wrote:
> 
> > On Tue, Mar 05, 2002 at 11:34:30AM -0500, Keith Jonathan Bodwell wrote:
> >
> >>Does anyone know why the stdio.h file that comes with gcc does not
> >>include the flushall() function, and is there a way I can get a stdio.h
> >>with the flushall() function that will work with gcc?
> >>      Thanks
> >>              Keith
> >>
> >>--
> >>
> > Is what you want to do is flush all output streamsi? well the man page
> > says that fflush can do that:
> >  If the stream argument is NULL, fflush  flushes  all  open
> >         output streams.
> >
> 
> --
> Keith Jonathan Bodwell
> ------------------------------
> Civil Engineering Student
> ------------------------------
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> ------------------------------
> http://www.keithbodwell.com
> ------------------------------
> 303 Notch Hill Rd.
> North Branford, CT 06471
> (203) 481-9925



_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list

Reply via email to