The combine function been bug since yesterday.
Been trying everything back then, define in the source file, remove some code to prevent overlapping definition, etc...
I don't know what I should do, can anyone help on this?
#ifndef SALES_DATA
#define SALES_DATA
#include <iostream>
struct Sales_data {
// new members: operations on Sales_data objects
std::string isbn() const { return bookNo; }
double avg_price() const;
Sales_data& combine(const Sales_data&);
// data members are unchanged from
std::string bookNo;
unsigned units_sold;
double revenue;
};
Sales_data& Sales_data::combine(const Sales_data &rhs)
{
units_sold += rhs.units_sold;
revenue += rhs.revenue;
return *this;
}
std::istream &read(std::istream & is, Sales_data &item);
std::ostream &print(std::ostream &os, const Sales_data & item);
Sales_data add(const Sales_data &lhs, const Sales_data &rhs);
#endif