O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Formatted I/O Revisited

You first read about formatted I/O in Chapter 5, “Console I/O,” where you learned to direct output to the screen and retrieve input from the keyboard. These interfaces with the outside world are called streams. A stream is a sequential source of data and can be read-only or read-write. The operating system is responsible for connecting the streams to the actual hardware (screen, printer, hard disk drive, keyboard, and so on).

In most C language implementations, the operating system-specific code is written in such a way as to treat files and streams in roughly the same manner. For example, you have already seen that the console can be referred to as:

stdinStandard input stream
stdoutStandard output stream

These are essentially ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required