Friday, 24 April 2015

Mapping Console in C++

C++ uses the concept of streams and stream classes to perform I/O operations with console and disk files. The stream classes supporting console-based input and output. Streams are classified into input streams and output streams. Streams resemble the producer and consumer model.

The producer produces items to be consumed by the consumer. The producers and consumers are connected by the C++ operators >> or <<. In C++ the I/O system is designed to operate on a wide variety of devices including console, disks, printer, etc. It is designed to provide a consistent and device independent interface.

A stream is a series of bytes, which act either as source from which input and data can be extracted or as destination to which the output can be sent. The source stream provides data to the program called the input stream and the destination stream that receives data from the program is called the output stream.

The C++ language offers a mechanism, which permits the creation of an extensible and consistent input-output system in the form of streams library. It is collection of classes and objects, which can be used to build a powerful system, or modified and extended to handle the user-defined data types.

No comments:

Post a Comment