0
    Fraction Fraction::operator *= (const Fraction& rightOp)
    {
        numerator = numerator * rightOp.numerator;
        denominator = denominator * rightOp.denominator;
        simplify();

        return whatDoIReturnHere???;
    }

I'm overloading the *= operator and I'm calling it in main as:

Fraction f1;
Fraction f2;

f1 + f2;

So the operator overload is directly assigning f1 new values, but how do I return the f1 object as a Function object?

I've tried creating an Object inside the operator overload function, and just return that object, but I'm looking to update the f1 object and return it but I'm not sure if there is a way too? Or perhaps i'm missing something.

  • Thank you!
273K
  • 29,503
  • 10
  • 41
  • 64
Tem195
  • 1

0 Answers0