Here I would like to share the concept of Program & console interaction in c++.
We have used cin & cout in cpp program, we can use scanf & printf too in cpp but to achieve oos concept, we have been using cin & cout.
So, What is cin & cout? They are stream objects.
Now what is stream?
A stream is a flow which take u from one place to another.
Like you have to enter some text thru keyboard(one place) it should be stored somewhere(other place) should be shown in screen(other place).
Like 8 decades back, we had a ship in London which used to sail to NewYork thru stream of water(sea, river).
Coming back to cin & cout.
cin is an instance of Istream_with_assign class which inherits istream & ios class.
cout is an instance of ostream_with_assign class which inherits ostream & ios class.
0 Responses to “Program _console Interaction in C++”