Get premium membership and access questions with answers, video lessons as well as revision papers.

Why would the following be an inappropriate use of an overloaded operator?coord coord:: operator%(coord ob) {double i;cout << "Enter a number:";cin >>i;cout << "root of...

      

Why would the following be an inappropriate use of an overloaded operator?
coord coord:: operator%(coord ob)
{
double i;
cout << "Enter a number:";
cin >>i;
cout << "root of " << i << "is ";
cout << ();
}

  

Answers


Davis
The overloading of the % operator is inappropriate because its operation is unrelated to the traditional use.
Githiari answered the question on May 31, 2018 at 17:56


Next: Relative to coord, overload the * and / operators. Demonstrate that they work.
Previous: a)Show how to overload the constructor for the following class so that unitialized objects can also be created. (When creating uninitialized objects, give x and...

View More Computer Studies Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions