Istream function to read with istream parameter
问题 I'm trying to understand this code istream &read(istream &is, Sales_data &item) { double price = 0; is >> item.bookNo >> item.units_sold >> price; item.revenue = price * item.units_sold; return is; } ostream &print(ostream &os, const Sales_data &item) { os << item.isbn() << " " << item.units_sold << " " << item.revenue << " " << item.avg_price(); return os; } I don't understand what are these function , also I can't understand why we use istream for reading and ostream for printing instead of