C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 12)
12.
cout is a/an __________ .
operator
function
object
macro
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
52 comments Page 1 of 6.

Sagar nale said:   2 years ago
Yes, cout is an object of the class ostream, and ostream is a class not cout thus cout is an object of the class ostream.

Ved prakash said:   4 years ago
cout is an object of class ostream that represents the standard output stream. So the class is ostream and object is cout.

Pratik said:   6 years ago
cout is an object of STDOUT class which is already in iostream header file.
(2)

Java Mari said:   6 years ago
We have already known operator means it will be performed some kind of operations between two are more operands. likewise here ,,"cout " perform an input operation by using the symbol ">>" but the same time it is an object.

How it is possible?

Because cout is a object for (derived class or sub class) ostream .and it's main class is "iostream.h" so the answer is (c) OBJECT.

Manoj Kumar Patel said:   7 years ago
In C programming language, We consider printf and scanf to be functions. when it comes to cout and cin, in C++ what are they?

I mean they cant be functions as they are not followed by parenthesis, so they are not functions .cout is an object of the class.

Gaurav Singh said:   7 years ago
The cout is an object of class ostream that represents the standard output stream oriented to narrow characters (of type char). It corresponds to the C stream stdout.

Divya said:   7 years ago
In c++, iostream is the header file, which contains i stream and o stream, jectathis two are objects, so cin is istream object and cout is ostream object.

Salman said:   7 years ago
Cout: is an object of type ostream.

Cin: is an object of type istream.
(1)

Deepak Sindhwani said:   7 years ago
cout is an object, then why it is used without the class name?

Rahul said:   7 years ago
Std::cout and std::cin are global objects of classes std::ostream and std::istream, which they've overloaded operator << and >>. You should read about operator overloading. The Cout is the object of type ostream. Cin is the object of type istream.
(2)


Post your comments here:

Your comments will be displayed after verification.