Standard Streams

The standard streams are primary sources for data input to programs and destinations for program output and diagnostic messages. Typically, programs designed to run from the command line use standard streams. Standard input comes from the keyboard unless redirected, and standard output goes to the display unless redirected.

IBM C and C++ Compilers supports the C standard streams and C++ iostreams.

C Standard Streams
Any program that includes the header <stdio.h> can use the C standard streams for I/O. The following streams are automatically set up by the run-time environment:

The streams stdprn and stdaux are reserved for use by the OS/2 operating system and are not supported by IBM C and C++ Compilers.

C++ iostreams
The iostream standard stream objects are:



Stream Processing


Redirect Standard Streams
Direct I/O to Memory Files
Open Streams Using Data Definition Names
View Output to Standard Streams from PM Programs


I/O Buffering
File Handles for Standard Streams
Example of Storing Data in Text and Binary Streams
C Library Functions: Stream Input/Output
File Options Used with Data Definition Names