Suppose you have a programmer-defined data type Data and want to overload the << operator to output your data type to the screen in the form cout << dataToPrint; and allow cascaded function calls. The first line of the function definition would be:

a. ostream &operator<<( ostream &output, const Data &dataToPrint )
b. ostream operator<<( ostream &output, const Data &dataToPrint )
c. ostream &operator<<( const Data &dataToPrint, ostream &output )
d. ostream operator<<( const Data &dataToPrint, ostream &output )

a. ostream &operator<<( ostream &output, const Data &dataToPrint )

Computer Science & Information Technology

You might also like to view...

Options to insert a field (e.g., a filename) into a header or footer are in the ________ group of the Design contextual tab

A) Header & Footer B) Header & Footer Elements C) Navigation D) Options

Computer Science & Information Technology

Answer the following statements true (T) or false (F)

1. Even though you have allocated memory by using new, there is no need to deallocate it with the delete command. 2. The method clear cannot simply set ItemCount to zero. 3. A class can have multiple destructors. 4. According to the text, you must write a destructor if your class allocates memory dynamically. 5. Classes that use dynamically allocated memory can depend on the compiler-generated destructor.

Computer Science & Information Technology