August 2012
Intermediate to advanced
976 pages
30h 17m
English
<<Ordinarily, the first parameter of an output operator is a reference to a nonconst ostream object. The ostream is nonconst because writing to the stream changes its state. The parameter is a reference because we cannot copy an ostream object.
The second parameter ordinarily should be a reference to const of the class type we want to print. The parameter is a reference to avoid copying the argument. It can be const because (ordinarily) printing an object does not change that object.
To be consistent with other output operators, operator<< normally returns its ostream parameter.
Sales_data Output Operator ...Read now
Unlock full access