If you want to be able to compile the following code,

Rational r1;
int x;

cout << r1 + x << endl;

which overloaded operator(s) do you need?
a. friend Rational operator+( const Rational& left, int right);
b. friend void operator+ (const Rational& left, int right);
c. friend ostream operator << (ostream& out, const Rational& object);
d. friend ostream& operator << (ostream& out, const Rational& object);
e. A and C
f. A and D


f. A and D

Computer Science & Information Technology

You might also like to view...

A(n) ___________ account has access to all computer files and settings.

A. administrator B. guest C. group D. standard

Computer Science & Information Technology

________ equate the values in a table or another query to the criteria value you set up in a query

A) Comparison operators B) Search criteria C) Is Null criteria D) Query operators

Computer Science & Information Technology

Word has built in macros that can be accessed from the Macros dialog box

Indicate whether the statement is true or false

Computer Science & Information Technology

To help human readers understand why a method’s statements are there, good programmers insert explanatory ____ into their methods.

A. conditions B. behaviors C. actions D. comments

Computer Science & Information Technology