Hello. I have this code I wrote myself where I overloaded operators to add, subtract, multiply and divide fractions. I want to implement the overloading into a class. Can anyone help me out? Thanks.
I have this code I wrote myself where I overloaded operators to add, subtract, multiply and divide fractions.
Your code adds, subtracts, multiplies and divides integers, not fractions.
Note that your divide operation is dividing integers, the result of integer division is going to be truncated. i.e. 3/4=0.
I want to implement the overloading into a class.
I'm not sure I understand what you're asking. You already have a class that overloads the standard arithmetic operators. Not clear what help you're asking for.