Question: Explain why operator must be overloaded as a non - member. Part 2 Overload the + operator so that the following lines of code run

Explain why operator must be overloaded as a non-member.
Part 2
Overload the + operator so that the following lines of code run in main:
More Details:
Define two functions. The prototypes will look like this:
Are they member or non-member functions? (Notice how many arguments they have)
Both functions will create a temporary date and return it.
Think about reusing as much code as possible.
a. For one implementation of operator +, can you call the operator ++ function?
b. For the second implementation of operator+, can you call the first operator + function?
c. Together these two functions should be no more that 10 lines of code in the bodies. If you make it longer, you are working too hard.
Which of the two functions must be defined as a non-member? Why?
Sample Run (after Part 2)
Explain why operator < < must be overloaded as a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!