d5f
C Input and Output
Contents|Index|Previous
C
Input and Output
libio
is distributed with a complete implementation of the ANSI C stdio
facility. It is implemented using streambuf objects. See Wrappers
for C stdio.
The stdio
package is intended as a replacement for whatever stdio
is in your C library. Since stdio
works best when you build libc
to contain it, and that may be inconvenient, it is not installed by default.
Extensions beyond ANSI :
- A stdio
FILE
is identical to a streambuf.
Hence there is no need to worry about synchronizing C and C++ input/output—they
are by definition always synchronized.
- If you create a new streambuf
sub-class (in C++), you can use it as a file
from C. Thus the system is extensible using the standard streambuf
protocol.
- You can arbitrarily mix
reading and writing, without having to seek in between.
- Unbounded ungetc
() buffer.
0