Classes

Given the following class, what is syntactically wrong with the implementation of the display function?
class Rational
{
public:
Rational( );
Rational(int numer, int denom);
Rational(int whole);

int getNumerator( );
int getDenominator( );

friend void display(ostream& out, const Rational& value);
private:
int numerator;
int denominator;
};

void display(ostream& out, const Rational& value)
{
out << value.getNumerator( ) << '/"<< value.getDenominator( );
}
Choose one answer.

a. out should be pass by value.

b. nothing

c. value must not be pass by reference.

d. The get functions are not const functions.

Questions by samah74

Showing Answers 1 - 3 of 3 Answers

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions