I Have a Fraction Class.
I need to do 3 operations on Fraction Object i.e
- Multiply two Fraction objects. e.g F1*F2
- Multiply a Fraction object by an integer. For ex. F1*3
- Multiply an integer by a Fraction object. For ex. 3*F1.
The first two case can be achieved by overriding the Fraction Class * operator.
Fraction operator*(const Fraction&);
Fraction operator*(const int&);
but how to multiply an integer by a fraction Object? The third case
Any Suggestions??
PS: I don't want to treat integer as a Fraction object e.g (3/1) and then doing the multiplication.