Re: C Interview Questions



Simon Biber said:

Richard Heathfield wrote:
Adrian said:
Also the standard says you can pass NULL to fflush to flush all open
streams.

Indeed, which is another reason that there is no such thing as *the*
correct argument to fflush.

Q: Which is the integer?
A: 23
B: 52.3
C: 22.1
D: -99.1

Obviously 23 is the integer.

It's not the only integer in the universe,
but it's the integer in the list following. That's how English works.

Point taken. Now, which is the correct argument to fflush?

a) stdout
b) stdin
c) stderr
d) All the above

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.



Relevant Pages

  • Re: C Interview Questions
    ... Simon Biber wrote: ... streams. ... which is another reason that there is no such thing as *the* correct ... argument to fflush. ...
    (comp.lang.c)
  • Re: C Interview Questions
    ... Richard Heathfield wrote: ... streams. ... which is another reason that there is no such thing as *the* ... which is the correct argument to fflush? ...
    (comp.lang.c)
  • Re: fflush(stdout);
    ... the fflush does not add anything. ... any terminal partial line on text streams. ... it releases the current contents of the output buffer to the system ... also trigger the necessary flushing. ...
    (comp.lang.c)
  • Re: how to check the scanf function if it will read more than one number
    ... >> For the same reason that pressing the handle on your toilet will not get rid ... a behaviour for fflush() on an input stream. ... > If it cause a potential danger, ... If fp is purely an input stream, ...
    (comp.lang.c)
  • Re: how truncate a file in C?
    ... > FC> fflush() guarantees nothing here. ... > fflushshall cause any unwritten data for that stream to be written ... for defined interaction between stdio streams and file descriptors, ...
    (comp.unix.programmer)