Skip to main content

15.2) Exercise 23


  1. Split up your solution to Exercise 22 in the manner suggested by the example seen earlier. Use the same filenames as that example: data.cpp, stats.cpp, main.cpp.
  2. Create a header file called data.hpp containing prototypes for the three functions defined in data.cpp and stats.cpp. Make sure that main.cpp contains a #include directive for this header file.
  3. Use the g++ command seen earlier to compile your program from these three source files. If you get compiler errors, double-check that all three files have the necessary #include directives in them.