Date: Mon, 9 Apr 2001 09:43:18 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: fflush (in djgpp) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 9 Apr 2001, Jack Klein wrote: > > > If you think I am exaggerating, run the program that you have and > > > enter "xyz" at the first prompt for age and see what happens. Even on > > > some systems that define a non-standard extension to fflush() that > > > does what you think you want it to do, it does not fix a problem like > > > this. > > > > With a proper format string, this can be handled with scanf as well. > > Yes, and one can spend years designing scanf() conversion specifiers. I think ``years'' is an exaggeration. > There is nothing that scanf() can do that fgets() followed by other > functions, including sscanf(), can't do as well or better. This argument goes both ways: scanf and fgets+sscanf are functionally equivalent. A C programmer should master both, IMHO.