stdio implements buffered input and output. What's a buffer ?
Streams can be :
- A buffer is a portion of memory set aside to store data, often before it
is sent to an external device or as it is received from an external device
- Buffers are common to many kinds of systems including mechanical ones.
- Film projectors tend to pull the film at a variable rate, so a loop of
extra film is made between the feed and takeup reels.
- A water tank on the top of an apartment building acts as a buffer for
water use in the building
The C streams we are studying are line buffered.
- Fully buffered: data is moved only when the buffer is full
- Line buffered: the buffer is a line (e.g., sequence of chars terminated
with a new line
- Unbuffered: no buffering
For buffered output, the information is queued up in the buffer until it
is full and then written.
Last Modified - Tuesday, 22-Aug-2006 07:14:08 EDT