Is this considered a bad way to clean the buffer?
I was reading the FAQs and there's an article called "Why it's bad to use feof() to control a loop" and now I'm worried. Thanks.Code:while(!feof(stdin) && getchar() != '\n');
Is this considered a bad way to clean the buffer?
I was reading the FAQs and there's an article called "Why it's bad to use feof() to control a loop" and now I'm worried. Thanks.Code:while(!feof(stdin) && getchar() != '\n');
Well if you just read that using feof to control a loop is bad, then doing so is what, good, or bad?
Quzah.
Hope is the first step on the road to disappointment.
How should I do it then?
FAQ > How do I... (Level 2) > Flush the input buffer
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*