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.

VisualAge C++ 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 VisualAge C++.

C++ iostreams
VisualAge C++ provides 2 versions of the C++ iostreams:

The input streams are istream and wistream objects. The output streams have type ostream and wostream. The names of the wide character streams and classes start with a "w". 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