dimanche 18 février 2018

What does 'return *this' actually do?

Sales_data& Sales_data::combine(const Sales_data &rhs)
{
units_sold += rhs.units_sold; // add the members of rhs into
revenue += rhs.revenue; // the members of ''this'' object
return *this; 
}

What does return *this do?

Aucun commentaire:

Enregistrer un commentaire