Hello, I am writing a class for a mixed number, and I have all of the operator overloads working and such when it comes to other mixed number objects. But My conversion constructor for if just an int is entered is not working. If someone could take a quick peak and see if anything jumps out, it would be much appreciated.
Declaration:
Definition:
Code:
Mixed::Mixed(int w){
whole = w;
numerator = 0;
denominator = 1;
}
These are the operations I am trying to perform and getting a type conversion error:
Code:
Mixed x;
cout << "(x + 10) = " << x + 10 << '\n';
cout << "(x - 4) = " << x - 4 << '\n';
cout << "(x * -13) = " << x * -13 << '\n';
cout << "(x / 7) = " << x / 7 << '\n';