buffer confusion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • john eipe
    New Member
    • Feb 2011
    • 2

    buffer confusion

    Hi

    Could anyone clarify on the types of buffers used by a program?

    For eg:

    I have a C program that reads from a stdin to stdout.

    What are the buffers involved here? I'm aware that there are 2.
    One provided by the kernel on which a user don't have any control.
    One provided with standard streams namely stdout, stdin and stderr. Each having a separate buffer.

    Is my understanding correct?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    A buffer is a very general term. All it means ia a "work area". There is a buffer for stdin, stdout, and stderr streams. You have no control over any of these buffers since they are part of the system and not part of your program. The most you do is flush the stdout and stderr buffers.

    Similarly, there are buffers associates with each of your files just like the ones for stdin, stdout and stderr.

    Maybe you could explain your question more fully.

    Comment

    Working...