On 20 Mar 2007 08:52:51 -0700, vishal thakur <[EMAIL PROTECTED]> wrote:
> On 3/20/07, Paul Herring <[EMAIL PROTECTED]> wrote:
> > On 19 Mar 2007 20:38:07 -0700, vishal thakur <[EMAIL 
> > PROTECTED]<lahsiv.vishal%40gmail.com>>
> > wrote:
> > > I think flushing buffer (fflush(stdin), if using stdin as your stream)
> > > will
> > > solve your problem, but flush will work in case of stdin but it will not
> > > give desired output for file stream
> >
> > fflush() is not required to work with stdin (or with cin.)
>
> Can you clear little bit on this : " fflush() is not required to work with
> stdin (or with cin.)"

fflush() is for flushing output streams, not input streams. (Your
compiler might allow it on input streams, but not every compiler will
support it.) For example:

http://www.hmug.org/man/3/fflush.php

makes no mention of input streams, only output streams.


-- 
PJH
Aio, quantitas magna frumentorum est

Reply via email to