Re: C Interview Questions



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.

--
Simon.
.



Relevant Pages

  • Re: C Interview Questions
    ... Richard Heathfield wrote: ... and stdout is only /one/ correct argument for fflush. ... I thought stdin, stdout, stderr where all macros to FILE * for the 3 streams. ... Now the standard does say for buffered streams, ...
    (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 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)
  • Re: scanf behaviour
    ... Richard Heathfield wrote: ... U haven't provided any reference for your claim that fflush(stdin) is ... If stream points to an output stream or an update stream in which ...
    (comp.lang.c)