C60. C Streams


Streams
In C, the term stream means any source of input or any destination for output. Many small programs, like the ones in previous chapters, obtain all their input from one stream (usually associated with the keyboard) and write all their output to another stream (usually associated with the screen).
Larger programs may need additional streams. These streams often represent files stored on various media (such as hard drives. CDs, DVDs, and flash memory), but they could just as easily be associated with devices that don't store files: net­work ports, printers, and the like. We'll concentrate on files, since they're common and easy to understand. (I may even occasionally use the term file when I should say stream.) Keep in mind, however, that many of the functions in work equally well with all streams, not just the ones that represent files.

No comments: