Re: how to check the scanf function if it will read more than one number
- From: "Chuck F. " <cbfalconer@xxxxxxxxx>
- Date: Tue, 03 Jan 2006 01:39:49 -0500
Moosdau wrote:
Peter Nilsson wrote:
Your implementation probably defines a behaviour fflush on input streams. It would do so as an extension. That extension is not topical in comp.lang.c.
it do be that. I think I've already known the answer. the below is I copied from MSDN:
The fflush function flushes a stream. If the file associated with stream is open for output, fflush writes to that file the contents of the buffer associated with the stream. If the stream is open for input, fflush clears the contents of the buffer.
Which is typical of Microsoft ignoring standards. They encourage people to write non-standard code, which is then tied to their own systems, and thus increases their income.
For general systems where what, if anything, functions as an input mechanism is not defined, the C language has no control. There is no way it can possibly anticipate the arrival of input. Thus input routines, when called, have to await actual input before returning. There may not be any input buffer, and if there is there is no defined way of interrogating it for non-emptyness. Thus the language cannot insist on fflush functioning on input streams, and any attempt to so do makes the program non-portable.
-- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson More details at: <http://cfaj.freeshell.org/google/> .
- References:
- how to check the scanf function if it will read more than one number
- From: moosdau
- Re: how to check the scanf function if it will read more than one number
- From: Keith Thompson
- Re: how to check the scanf function if it will read more than one number
- From: moosdau
- Re: how to check the scanf function if it will read more than one number
- From: Richard Heathfield
- Re: how to check the scanf function if it will read more than one number
- From: Moosdau
- Re: how to check the scanf function if it will read more than one number
- From: Peter Nilsson
- Re: how to check the scanf function if it will read more than one number
- From: Moosdau
- how to check the scanf function if it will read more than one number
- Prev by Date: Re: Segmentation fault - interesting problem with array
- Next by Date: Re: Segmentation fault - interesting problem with array
- Previous by thread: Re: how to check the scanf function if it will read more than one number
- Next by thread: Re: how to check the scanf function if it will read more than one number
- Index(es):
Relevant Pages
|