Computer Science - Object Oriented Programming Using C++ - Discussion

Discussion Forum : Object Oriented Programming Using C++ - Section 6 (Q.No. 15)
15.
The extraction operator >> is a(n)
overloaded function
C++ class
C++ object
static reference variable
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
1 comments Page 1 of 1.

Ayesha said:   5 years ago
Answer: Option A.

In C++, stream insertion operator << is used for output and stream extraction operator >> is used for input.

Cout is an object of ostream class which is a compiler defined class. When we do cout<<obj where obj is an object of our class, the compiler first looks for an operator function in ostream, then it looks for a global function. One way to overload insertion operator is to modify ostream class.

Post your comments here:

Your comments will be displayed after verification.