istream & /* <--here */ read(istream &is, Sales_data &item)
{
double price = 0;
is >> item.bookNo >> item.units_sold >> price;
item.revenue = price * item.units_sold;
return is;
}
//main function
Sales_data total;
if (read(cin,total))
{
Sales_data trans;
read(cin,trans);
// ...
I don't quite understand what does the reference mean in this function, I got an error if I delete the reference.