Wednesday, October 22, 2008

Console I/O Streams

There are three types of Console I/O Stream-

cout - Standard Output Stream
cin - Standard Input Stream
cerr - Standard Error Output Stream


cout :

It is used to display data on console.
Example :
cout<<"Sachin is a greatest Cricket Player"
cout<<234;
In general form :
cout< here expression can be any valid C++ expression

cin :

It is used to capture data from keyword.
Example :
int age;
cin>>age;
The general form :
cin>>variable;

cerr :

It is used to display errors on console.

No comments: