Input and Output Streams

Books about C often refer to “input streams” and “output streams.” A stream is a sequence of bytes flowing into the program (input) or flowing out (output). The data might have originally come from the keyboard, a modem, a disk file, or some other peripheral device. The outgoing data might be sent out to the screen, a modem, or a disk file.

Thus, when you see a phrase such as “opening a stream,” it means opening a line of communication to the disk drive or to some other peripheral.

Summary: Peripherals and files are called “streams” in C.

The five streams always open and available for DOS input or output are shown in Table 11.1.

Table 11.1 Standard I/O Streams

Name Stream

stdin Standard input (keyboard)
stdout Standard output (screen)
stderr Standard error channel (screen)
stdprn Standard printer (parallel port)
stdaux Standard auxiliary device (serial)

NOTE:

QuickWin programs do not support the stdprn and stdaux streams.