Simplify Fraction Help
hi, i wrote this function to help me reduce a fraction but i can't seem to get it to work. the errors say
invalid use of member (did you forget the `&' ?)
expected `)' before ':' token
both occor at the line i starred.
void Rational::simplify(Rational rational)
***** for (x=2; x <= ((num>den) ? num :den); x++) *****
if (num%x==0 && den%==0)
I believe the commonly used approach here is to find the greatest common divisor, then divide both the numerator and denominator by the GCD. What's with the unused Rational parameter?
Anyway, you might want to post the smallest and simplest program that demonstrates the error.