I understand the basics of the error message; it is alerting me that this code may not return anything at all. However, I do not understand why. My code is perfect, is it not?
rational operator / (const rational &lhs, const rational &rhs)
{
if(rhs.numerator() != 0)
{
int numerator = lhs.numerator() * rhs.denominator();
int denominator = lhs.denominator() * rhs.numerator();
rational quotient(numerator, denominator);
return quotient;
}
else cout << "error" << endl;
} //this is where error is occurring