This works fine, but note the inclusion of the read and print functions in the header file. I really want these defined in a separate source file, with only function declarations in the header file. So I modify the header file to contain only the function declarations and create a separate .cpp file for the definition of read and print. These files are shown below.
When you include a header file you're telling the toolchain, in a very real sense, to paste the contents of the header file in at that point of the source code file. By making another source code file, and including it in both 'main.cpp' and 'Sales_data.cpp' you are creating definitions for 'Sales_data::combine()' in two locations. The solution is to move the definition for that function into 'Sales_data.cpp' with the other two functions.
These instructions are for the compiler , to tell it to skip if its knows the class already . Which also means that the compiler looks multiple time at this header