Operator overloading Using Ratio Class | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Operator overloading Using Ratio Class

https://code.sololearn.com/ca142a50a21A The question is: Implement the binary subtraction operator, the unary negation operator, and the less-than operator < for the Ratio class (see Example 11.4 on page 259). In line 46 of this code I have to return an integer..Will I write return 0? Also for this code,how can I write the main() properly to test the code?

7th May 2021, 5:44 PM
Ramisa Fariha
Ramisa Fariha - avatar
1 Answer
+ 1
@Martin Yes, I have noticed that too. The examples given in one chapter are not completed..it's like the rest of them are in the example of another chapter...They are all related
8th May 2021, 10:59 AM
Ramisa Fariha
Ramisa Fariha - avatar