C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 26)
26.
Which of the following is the correct class of the object cout?
iostream
istream
ostream
ifstream
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
35 comments Page 1 of 4.

Dhiraj Hargode said:   7 years ago
Actually they ask for object not for header file ao in iostream header file two different objects are there for different purposes ostream for cout and itream for cin purpose.

Pooja Chougule said:   1 decade ago
I think, iostream is concern with both input(cin) and output(cout).

Operations but, question ask specific to cout thus ostream(stream for output) is more correct.

Arpita said:   10 years ago
Here as asked in the question the correct class of cout not for cout an cin.

So the correct one is ostream if it is asked cin and cout both then it is iostream.

Arjun EJ said:   1 decade ago
cout is for output and cin is for input.

For cout-include the header <istream>.

For cin -include the header <ostream>.

Shreyas said:   1 decade ago
iostream has 2 parts istream and ostream and cout is found in ostream class but the apparent answers are both ostream and iostream.

Pooja said:   1 decade ago
I think <iostream.h> is the library function & we can't use it only ostream for cout or istream for cin .

Amruta said:   1 decade ago
In iostream, 'i ' is input and 'o' is output. And cin object is used based on 'i' stream and cout as 'o' stream

Kicha said:   6 years ago
iostream means both cin and cout, istream means only cin and ostream mean the only cout so ostream is correct.
(15)

Saurav Kumar said:   1 decade ago
iostream means both cin and cout, istream means only cin and ostream mean only cout so ostream is correct.

Babaljeet said:   1 decade ago
But iostream includes both input and output operations then why iostream is not correct for cout ?


Post your comments here:

Your comments will be displayed after verification.