11-20-2018, 06:17 PM
The text is hit and miss with regards to informing the reader whether or not an associated file needs to be created or where to put the code in an existing file. With the first example, or even second, it might be best to give the reader a clue as to where to put the code, but perhaps not needed on examples that follow as long as the examples that follow are consistent with the previous ones.
In this particular case, the text instructs the reader to create the Objects class (assuming the reader creates the associated files for the class). However, these files are already present in the example starter project but not complete.
The other issue is with Shooter on page 90 where the code in the text shows a Shooter constructor with a reference to a Base Objects constructor that takes a 'char*' and 'MyFiles*' but this constructor is not mentioned in the book nor is it present in the existing Objects file for the starter code. The text does state to add Shooter.cpp and Shooter.h to the project which are not present in the Stater project.
In this particular case, the text instructs the reader to create the Objects class (assuming the reader creates the associated files for the class). However, these files are already present in the example starter project but not complete.
The other issue is with Shooter on page 90 where the code in the text shows a Shooter constructor with a reference to a Base Objects constructor that takes a 'char*' and 'MyFiles*' but this constructor is not mentioned in the book nor is it present in the existing Objects file for the starter code. The text does state to add Shooter.cpp and Shooter.h to the project which are not present in the Stater project.