Main Page

Previous Page
Next Page

[Page 624 (continued)]

Self-Review Exercises


Fill in the blanks in each of the following:

  1. Suppose a and b are integer variables and we form the sum a + b. Now suppose c and d are floating-point variables and we form the sum c + d. The two + operators here are clearly being used for different purposes. This is an example of __________.

  2. Keyword __________ introduces an overloaded-operator function definition.

  3. To use operators on class objects, they must be overloaded, with the exception of operators __________, __________ and __________.

  4. The __________, __________ and __________ of an operator cannot be changed by overloading the operator.


Explain the multiple meanings of the operators << and >> in C++.


In what context might the name operator/ be used in C++?

[Page 625]

(True/False) In C++, only existing operators can be overloaded.


How does the precedence of an overloaded operator in C++ compare with the precedence of the original operator?

Previous Page
Next Page