Input/Output
We'll start the chapter with a
discussion of some basic issues: the stream concept, the FILE type, input and output
redirection, and the difference between text files and binary files. We'll then
turn to functions that are designed specifically for use with files, including
functions that open and close liles . After covering printf, scanf, and related
functions for "formatted" input/output we'll look at functions that read and write
unformatted data:
getc. putc, and related functions, which read
and write one character at a time .
gets, puts, and related functions, which read
and write one line at a time.
f read and f write, which read and write
blocks of data.
In C89,
all standard input/output functions belong to , but such is not
the case in C99, where some I/O functions are declared in the
header. The functions deal with wide characters rather than
ordinary characters; the good news is that most of these functions closely
resemble those of . Functions in that read or
write data are known as byte
input/output functions; similar functions in
are called
wide-character input/output functions,
No comments:
Post a Comment