tinycities
Programmer
Hi This program preforms various types of arithmeitc on rational #s, but does not divide the fractions into whole #s. I wrote a class called Rational and created several memb. functions. When I attempt to define my print function I get a compile error. I have pasted the code and error below. Do you know what's up with this? Thanks!
P.S.
I decided to include the previous function def. which is the default constructor(Rational::Rational()), just in case the compiler was off by one line.
Rational::Rational()
{
numer = 0;
denom = 1;
}
void Rational print(ostream& out_stream)
{
out_stream << numer << "/" << denom;
}
Info :Building...
Info :Compiling C:\BC5\BIN\assn7.cpp
Error: assn7.cpp(87,20):Size of 'Rational' is unknown or zero
Error: assn7.cpp(87,20)eclaration syntax error
P.S.
I decided to include the previous function def. which is the default constructor(Rational::Rational()), just in case the compiler was off by one line.
Rational::Rational()
{
numer = 0;
denom = 1;
}
void Rational print(ostream& out_stream)
{
out_stream << numer << "/" << denom;
}
Info :Building...
Info :Compiling C:\BC5\BIN\assn7.cpp
Error: assn7.cpp(87,20):Size of 'Rational' is unknown or zero
Error: assn7.cpp(87,20)eclaration syntax error