Question: Suppose that a new Complex class that represents a complex number has the following prototype for an overloaded multiplication operator method: Complex operator*(const Complex&) const;

Suppose that a new Complex class that represents a complex number has the following prototype for an overloaded multiplication operator method:

Complex operator*(const Complex&) const;

For the expression a * b (where a and b are both objects of class Complex), what will be the actual member function call generated by the compiler?

A.

a.operator*(b)

B.

b.operator*(a)

C.

operator*(a, b)

D.

Overloaded operators never generate member function calls.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solutions Step 1 Answer C c1operatorc2 Explantion ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!