Sample Widget

A Sample C++ Program

1] IOSTREAM.H :- 

C style of Input/Output

In 'C' language, the Input/Output is buffered.The drawback of buffered Input/Output is that the programmer has to bother about the complexity of the actual physical Input/output device.

C++ style of Input/Output




In C++, the input/output is streamed. The stream is just a sequence of bytes. The stream that obtain input from source is called the source stream and the stream that makes output on to the destination is called destination stream. The advantage of using the stream is that the programmer need not bother about the actual physical input/output devices. 
                       The stream is implemented through a hierarchy of devices called stream classes. The header file  iostream contains the declaration of these classes.


2) cout : - (In cout 'c' is refered to console whice means output device i.e 'monitor') :- 'cout' is  a predefine stream object of the 'ostream'  class and is responsible for handling output to the  monitor.

3) cin : - 'cin' is a predefine stream object of  'istream' class and is responsible for obtaining input from keyboard. 

4)  <<:- (Originally it is a bitwise leftshift  operator but here it is overloaded as insersion (put-to) operator) :-This operator is used for redirecting the output to destination stream.

5)  >> : - (Originally it is a bitwise rightshift operator but here it is overloaded as extraction (get-from) operator:- This operator is used for obtaning input from  the sourcestream. 

6) <<  << (cascading) :- The multiple occurance of the insersion or extraction operators in a single statement is called cascading.

Visitors

About Me

I am working as computer teacher in Ambuja School