|
From: <ca...@kr...> - 2003-04-26 07:22:34
|
hi Ioannis,
> fflush() is intended for output streams, not input. For example
> fflush(stdin); does not work in GNU/Linux. So you can't expect
> fflush(stdin); to be portable. You will have to use aither a plain
> getchar(); call after a plain scanf() or create a clean function in the
> style:
> void clean_stdin()
> {
> while(getchar()!='\n')
> ;
> }
ok, I now understand why not to use fflush(). (I would have noticed
when porting to linux whats the final destination... ;)
so you mean, I scanf() whatever I need and then let getchar() go
through stdin again clearing everything until the first '\n', right?
ok then, that would solve the first halve of my problem.
for the second I open another thread. thanks a lot!
gruss
/Christian mailto:ca...@kr...
---
I propose that the following character sequence for joke markers:
:-)
19-Sep-82 11:44 Scott E Fahlman
|