call of overloaded `hypot(double&, double&)' is ambiguous
note candidates are: double hypot(double, double)
note void hypot(double&, double&)
obviously the first is an error message and i've assumed the second line is an example of what it is meant to be and the third is what i've actually got but I dont understand why i'm getting this error message. Here's the code:
void hypot(double &adj, double &opp);
// code ....
case'4':
cout << "To find the hypotenus of triangle abc please give the values of:\n\n";
cout << "Side a: ";
cin >> adj;
cin.get();
cout << '\n' << "Side b: ";
cin >> opp;
cin.get();
cout << "\n\n";
hypot(adj, opp);
restart();
// code...
void hypot(double &adj, double &opp)
{
cout << "The hypotenuse of this triangle is ";
cout << sqrt((adj*adj)+(opp*opp));
adj = opp = 0;
return;
}
I dont understand why i'm getting this. All my other functions are of return type void, all use have reference parameters, and have arguments of type double. The only thing different is that this is the only one that has two parameters.