Please help

7. Consider the following declaration:

class Strange
{
.
.
.
};

(a). Write a statement that shows the declaration in the class Strange to overload the operator >>.

(b). Write a statement that shows the declaration in the class Strange to overload the binary operator + as a member function.

(c). Write a statement that shows the declaration in the class Strange to overload the operator == as a member function.

(d). Write a statement that show the declaration in the class Strange to overload the postincrement operator ++ as a member function.

8. Assume the declaration of the above exercise.

(a). Write a statement that shows the declaration in in the class Strange to overload the binary operator + as a friend function.

(b). Write a statement that shows the declaration in in the class Strange to overload the operator == as a friend function.

(c). Write a statement that shows the declaration in in the class Strange to overload the postincrement operator ++ as a friend function.


Read this -> https://www.learncpp.com/cpp-tutorial/93-overloading-the-io-operators/
Apply some newly gained knowledge to your problem.
Topic archived. No new replies allowed.