Concept of Stream and It's bytestream class in c++

Concept of streams:-

stream class in c++
Concept of stream 




  • A stream is general name given to flow of data
  • A stream is a sequence of byte.
  • The source stream that provides data to programs is called input stream.
  • The destination stream receive output from the program is called output stream.
  • In header <iostream>, a set of class is defined that supports I/O operations.
  • The classes used for input/output to the devices are declared in the IOSTREAM file.
  • The classes used for disk file are declared in the FSTREAM file.


Input/output stream :-

input and output stream in c++
Input and output stream in c++



Stream class for console I/O operations :-

Stream class in c++
stream class in c++






  • ios class contains basic facilities that are used by all other input and output classes (Necessary for formatted input/output).

  • Also contains pointer to a buffer object(streambuf).

  • streambuf provided an interface to physical devices through buffer.

  • iostream class inherits properties istream and ostream class through multiple inheritance.

  • The class ios declared as the virtual base class so that only one copy of its members  inherited by the iostream.

  • istream_withassign, ostream_withassign and iostream_withassign and assignment operation to its base classes.

  • Cout which is directed to video display, is predefined object of ostream_withassign.

  • Similarly cin is an object of istream_withassign.

Comments

  1. Mind-blowing post, it's really helpful to understand concept of stream👍

    ReplyDelete

Post a Comment