C++ Programming - OOPS Concepts - Discussion

Discussion :: OOPS Concepts - General Questions (Q.No.12)

12. 

cout is a/an __________ .

[A]. operator
[B]. function
[C]. object
[D]. macro

Answer: Option C

Explanation:

No answer description available for this question.

Rohit said: (May 1, 2012)  
Can anyone tell why cout is an object?

Suman.K said: (May 20, 2012)  
Cout is stream extraction operator
It is predefined and the header file is iostream.h

Ratnesh said: (May 24, 2012)  
cout is object of ostream class & cin is the object of istream class. istream & ostream makes iostream

Sanil said: (Jul 19, 2012)  
Can anyone tell why cout is an object ?

Shona said: (Jul 24, 2012)  
cout is an object of class ostream that represents the standard output stream. So the class is ostream not cout.

Sandesh said: (Aug 19, 2012)  
cout is a object and not a function. cout is an output stream object that refers to the monitor whereas cin refers to the keyboard.Both are defined in the header file <iostream.h>

Amarn Kokare said: (Sep 21, 2012)  
count is a object of a ostream class and we can include a library file in program header, and using this object user can print a data on console.

Rajesh said: (Dec 2, 2012)  
Its object in ostream.h header file and cin is in istream.h.

Navin said: (Jan 9, 2013)  
If cout is an object. Can anyone tell me where this object is getting created ?

Sumeet said: (Jan 13, 2013)  
cout is a stream extraction operator. It is an object of ios class which is predefined in iostream.h header file.

Pooja said: (Jan 17, 2013)  
cout is predefined in iostream.h.

Can anyone tell me how it is object.

Pawan Gupta said: (Mar 1, 2013)  
It belongs to iostream class so member of any class is an object.

Saba said: (May 4, 2013)  
I think cout is a function similar to printf in C programming. It may be an object only when we define it so but primarily it can't be an object.

Aarti said: (May 20, 2013)  
If count is an object in iostream.h, then what is the name of class of count's object, because every object must have an class.

Pavan Golesar said: (Jun 9, 2013)  
cout is object of ostream.h header file and cin is object of istream.h header file.

Nishad Magdum said: (Jul 4, 2013)  
cout is object of class ostream and cin is object of class istream.

Naveen said: (Jul 11, 2013)  
Why printf is function?

Ponnarasi said: (Aug 9, 2013)  
cout is a print an output so why its called object.

Amol Bendale said: (Aug 22, 2013)  
Why cout is not function?

Pratishruti said: (Sep 13, 2013)  
Why not cout be an operator<<?

Ashok@Cmc said: (Sep 16, 2013)  
cout is an object of class ostream that represents the standard output stream. It corresponds to the cstdio stream stdout.

Chandan said: (Dec 1, 2013)  
Object is the simple variable of a class. So if we will open <iostream> header then we can found the statement.

Extern ostream cout; means cout is the variable of ostream class so. For this reason it is an object.

Muzamil said: (Jan 13, 2014)  
If cout is an extraction operator, so how could be it an object?

Amar said: (Jan 23, 2014)  
Object through call the value to accept and display function then use cout and cin in an object.

Divya said: (Feb 17, 2014)  
It is an object of ostream class, which is associated with extraction operator (<<) , here extraction operator is overloaded.

Siddhi Dubey said: (Mar 31, 2014)  
cout is similar to printf in C prog, so why it is not a function?

Alex said: (Jul 1, 2014)  
"cout" is an object of "ostream_withassign" class.
And
"cin" is an object of "istream_withassign" class.

Meester Anony said: (Nov 20, 2014)  
Cout is when someone tries saying caught but doesn't know how to pronounce it properly.

Rohini said: (Dec 13, 2014)  
cout is an object because it is an object of ostream and we use the header file <iostream> here. It allows both input and output operations.

Kiran said: (Jan 3, 2015)  
cout is an object of ostream & cin is a object of istream.

Sabari said: (Jan 18, 2015)  
var = cout<<something twist this is return any thing because its a function.

Rajasekhar said: (Mar 3, 2015)  
<< is an operator which can print data on a console.

"<<" is an operator that can be overloaded in such a way that can print data on console in ostream class.

cout is an object, when ever cout << "Raja sekhar"; executes.

Compiler class as cout.operator<< (.).

Manish Jatiwal said: (Mar 24, 2015)  
cout is object of class ostream.

cin is object of class istream.

Extraction and insertion are operator.

Pritesh said: (May 29, 2015)  
Give definition of object.

Suvarna Pawar said: (Jun 30, 2015)  
It is wrong concept cout is not object its a function.

Bhagyashree said: (Jul 9, 2015)  
cout is an object of ostream_withassign class.

Naman said: (Aug 7, 2015)  
Object of class ostream that represents the standard output stream oriented to narrow characters (of type char). It corresponds to the C stream stdout.

Lalit said: (Jul 29, 2016)  
cout is a statement. So, why it is an object.

Shubham said: (Aug 20, 2016)  
How its an object?

Can anyone please explain it very well?

Pranil said: (Oct 13, 2016)  
How its an object? Please explain.

Salman said: (Dec 30, 2016)  
I also want to know that, please deacribe it.

Lata said: (Feb 1, 2017)  
How cout is an object?

Explain.

Rahul said: (Mar 26, 2017)  
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.

Deepak Sindhwani said: (Apr 7, 2017)  
cout is an object, then why it is used without the class name?

Salman said: (Apr 20, 2017)  
Cout: is an object of type ostream.

Cin: is an object of type istream.

Divya said: (May 28, 2017)  
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.

Gaurav Singh said: (Jun 27, 2017)  
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.

Manoj Kumar Patel said: (Oct 14, 2017)  
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.

Java Mari said: (Jan 26, 2018)  
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.

Pratik said: (Oct 7, 2018)  
cout is an object of STDOUT class which is already in iostream header file.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.