Answered step by step
Verified Expert Solution
Question
1 Approved Answer
12. Suppose that you define a new class called foo. For two foo objects x and y, you would like the expression xty to be
12. Suppose that you define a new class called foo. For two foo objects x and y, you would like the expression xty to be a new foo object. What is the prototype of the function that you must write to enable expressions such as x+y? 13. I have written a class with an operator+ which is not a member function, but the operator+ implementation does access the private member variables of objects in the class. What did I need to do to gain this access? 14. Write one clear sentence telling me when it would be appropriate to declare a function as a friend of some class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started