From: Sunil Rao Newsgroups: comp.os.msdos.djgpp Subject: Re: gets Date: Wed, 27 May 1998 22:27:58 +0100 Organization: Sunil Rao's Wonder Machine Distribution: world Message-ID: References: <1998052404332600 DOT AAA20938 AT ladder03 DOT news DOT aol DOT com> NNTP-Posting-Host: raos.demon.co.uk MIME-Version: 1.0 Lines: 31 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <1998052404332600 DOT AAA20938 AT ladder03 DOT news DOT aol DOT com>, Peleg79593 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 @ * ORU WHISKY, ORU MASALA DOSA... MIND IT!