V
vin pane
your code will not work to flush the previous contents.
okey I want three line code.
main()
{
getchar();
sleep();
eat_stdin(); // flush_stdin --- some code here to remove what user is
going to //press between this delay of 5 secs .including
enter key. she may press anything.
getchar(); // this last getchar should work as we have given a call
to some //keyboard flushing function .
}
My questions is whether a stdin in Linux Line buffered IO or
Unbuffered IO ? If it is some kind of buffering IO, I must able to
write that buffer . I mean to say that the code for memset operations
is the most promissing solution I found. It works what my requirement
is. since memset performs operation on the void pointer why not FILE *
stream ? ultimatly think about the buffering part !
I have found many solutions like setting the mode of the tty to raw &
then start readin , perform select call for SDTIN_FILENO ... I have
done many thing.
I wrote a code of 200 lines just to eat up the stdin !! In cases works
too.
-bye
< Dont want to make any special comment in the EOM like other do...>
okey I want three line code.
main()
{
getchar();
sleep();
eat_stdin(); // flush_stdin --- some code here to remove what user is
going to //press between this delay of 5 secs .including
enter key. she may press anything.
getchar(); // this last getchar should work as we have given a call
to some //keyboard flushing function .
}
My questions is whether a stdin in Linux Line buffered IO or
Unbuffered IO ? If it is some kind of buffering IO, I must able to
write that buffer . I mean to say that the code for memset operations
is the most promissing solution I found. It works what my requirement
is. since memset performs operation on the void pointer why not FILE *
stream ? ultimatly think about the buffering part !
I have found many solutions like setting the mode of the tty to raw &
then start readin , perform select call for SDTIN_FILENO ... I have
done many thing.
I wrote a code of 200 lines just to eat up the stdin !! In cases works
too.
-bye
< Dont want to make any special comment in the EOM like other do...>