Here is a bit of the code in question. the error is in line 13, "x = c.addition(d);" the problem has to do with something in another part of the code, as this section is a driver program.
Rational c( 2, 6 );
Rational d( 7, 8 );
Rational x; // creates three rational objects
c.printRational(); // prints rational object c
cout << " + ";
d.printRational(); // prints rational object d
x = c.addition( d ); // adds object c and d; sets the value to x
cout << " = ";
x.printRational(); // prints rational object x
The program has a header file, which is simply the class definition. It is correct.
Thus, the problem (insofar as I can determine) must lie in the addition function, shown below.
void Rational::addition(Rational d) // adds fractions
numerSum = (numerator * d.getDenominator()) + (denominator * d.getNumerator());
if (denominator <= d.getDenominator())
denominator = d.getDenominator();
I very well could be off base with this, so I am open to criticism. I have been programing for 4 years now, 2 of which at the collegiate level. Thus, I know the concepts fairly well, but some of the grittier applications throw me, and compiler error wording is, to say the least confusing, and, not far from that, a foreign language to me.
As a side note, I am using the DEV C++ compiler.
My friends are busy and my instructor is out of the office, so I need some help from those at this site. Thank you for any help or insight you can offer.