Mail Archives: djgpp/1998/05/27/18:47:50
In article <1998052404332600 DOT AAA20938 AT ladder03 DOT news DOT aol DOT com>, Peleg79593
<peleg79593 AT aol DOT com> writes
>Okay, so I want to use
>
>gets(x);
no, you don't. gets() is EVIL. use fgets() instead...
>So I add fflush(stdin)
you don't want to do this either... it's undefined.
>before and after all of my buffered inputs. Same problem. So, then, I put:
>
>gets(trash);
>
>before every
>
>gets(x);
>
>and, voila, it works. What gives here? Am I doing something wrong, or is this
>an acceptable way to clear the buffer?
no, it's not. your descriptio of your problem doesn't tell much. maybe
you ought to post some of your code.
--
Check out the ALL-NEW alt.comp.lang.learn.c-c++ FAQ list @
<http://www.raos.demon.co.uk/acllc-c++/faq.html>
* ORU WHISKY, ORU MASALA DOSA... MIND IT!
- Raw text -