Answer the following questions true (T) or false (F)
1. When overloading an operator, you cannot change the number of arguments an operator takes.
2. Overloaded operator <<, when used as an output, returns an ostream& to allow chains of output statements, and similarly the overloaded operator >> returns an istream&
1. True
Explanation: The compiler recognizes the operators and expects them have the usual of arguments.
2. True
Explanation: We do this so that our overloaded operator << mimics the behavior of the overloaded operator << for primitive types. Uniformity of behavior of user and built-in types is a goal of C++ design.
You might also like to view...
The ______ operation of the ADT stack adds an item to the top of the stack.
a. isEmpty b. push c. pop d. peek
You should make sure all the parts of your app are working before
a. using the Decomposition Principle b. writing the JavaScript part of the app c. making the design look better d. building the functions