Chapter 10 Operator Overloading

Ace your homework & exams now with Quizwiz!

The operators that cannot be overloaded are _______, _______, _______, and _______.

(.), (?:), (.*), and (::)

In what context might the name operator/ be used?

For operator overloading: It would be the name of a function that would provide an overloaded version of the / operator for a specific class.

Operator <<

The left-shift operator and stream insertion operator (depending on its context).

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

The precedence is identical.

Operator >>

The right-shift operator and the stream extraction operator (depending on its context).

(True/False) Only existing operators can be overloaded.

True

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

assignment (=), address (&), and comma(,).

The _________ operator reclaims memory previously allocated by new.

delete

The _________ operator dynamically allocates memory for an object of a specified type and returns a(n) ________ to that type.

new pointer

Keyword _________ introduces an overloaded-operator function definition.

operator

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 __________.

operator overloading

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

precedence, associativity, and "arity"

Append a(n) ___________ after the closing quote (") of a string literal to indicate that it's a C++14 string-object literal.

s


Related study sets

Final Exam - Florida Life and Health

View Set

ATI Fundamentals practice tests 2022

View Set

Microeconomics Econ 101 Chapter 8: The Costs of Taxation Notes

View Set

The Origins of Management - Scientific Management - Bureaucratic and Admin Management - Human Relations Management - Operations, Info, Systems, and Contingency Management

View Set

Exam 2 - Chp. 8: Groups and Teams

View Set

Matematika: Bangun Ruang sisi datar

View Set

Health Workflow Process Analysis and Redesign

View Set