I want to overload operator like this:
fraction operator / (int a, int b) // error here
{
return fraction(a,b);
}
(Not inside fraction class). But the compiler says:
[Error] 'fraction operator/(int, int)' must have an argument of class or enumerated type.
Can I get around this? (Just want when I write like 1/3 to convert into fraction(1,3) not fraction(1/3) (1/3 which equal 0.3333333 in float so when converting back into fraction, I will get 16666667/50000000, not 1/3)