How does printf works - Unix

This is a discussion on How does printf works - Unix ; I want to know how does printf (stdio library function) works? Does this depand on complier (I am using gcc on Linix) Does it uses some buffer in which it stores all what needed to be printed and in end ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: How does printf works

  1. How does printf works

    I want to know how does printf (stdio library function) works? Does
    this depand on complier (I am using gcc on Linix)

    Does it uses some buffer in which it stores all what needed to be
    printed and in end of program it prints that or something else.


  2. Re: How does printf works

    On Mar 22, 4:35 am, Sanchit wrote:

    > I want to know how does printf (stdio library function) works? Does
    > this depand on complier (I am using gcc on Linix)


    > Does it uses some buffer in which it stores all what needed to be
    > printed and in end of program it prints that or something else.


    Google "stdio buffering".

    A buffer is used. For 'printf' output is actually written to standard
    output when the buffer is full or a newline is written.

    DS

  3. Re: How does printf works

    On Mar 22, 5:53 pm, David Schwartz wrote:
    > On Mar 22, 4:35 am, Sanchit wrote:
    >
    > > I want to know how does printf (stdio library function) works? Does
    > > this depand on complier (I am using gcc on Linix)
    > > Does it uses some buffer in which it stores all what needed to be
    > > printed and in end of program it prints that or something else.

    >
    > Google "stdio buffering".
    >
    > A buffer is used. For 'printf' output is actually written to standard
    > output when the buffer is full or a newline is written.
    >
    > DS


    Thanks a lot... No body replied me with so small but meaningful answer
    on other groups.

+ Reply to Thread