OK,
Then concidure the following case :
I need to read the first 5 letters of each input line
entered by the user at a console.
for (count=0; count<2; count++){
for(count1=0; count1<5; count++){
let=getchar();
putchar(let);
}
//I need to clear stdin so if the user had
//entered more then 5 letters these letters will
//be flushed before I read the first 5 letters
//of the second line.
}
up to now I had used fflush(stdin) how would u do it ?
Erez
PS
--- Nadav Har'El <[EMAIL PROTECTED]> wrote:
> On Sun, Apr 28, 2002, Erez Boym wrote about "Re:
> Small C question":
> > fflush(stdin); worked grate on my R.H. 6.2
>
> Worked great? In what sense? Does it do that leaving
> out fflush(stdin)
> doesn't?
In the sense that it had done it's job in the above
example .
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]