www.gibmonks.com

Main Page




Previous Page
Next Page

[Page 624 (continued)]

Self-Review Exercises

11.1

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.

11.2

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

11.3

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


[Page 625]
11.4

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

11.5

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


Previous Page
Next Page