Visual C++ Problems/Changes The following is a list of changes made in the example programs of the text C++: An Introduction to Computing, 3rd edition (Adams & Nyhoff) for them to compile, link, and execute in Visual C++ 6.0. In addition to those listed, adding a return 0; at the end of each main() function will eliminate the warning message for main(). Chapter 6 Fig. 6.01-2 added two cin.get()s Fig. 6.03 deleted using namespace std; in Heat.cpp Chapter 8 Fig. 8.03 added cin.get() after getline Fig. 8.06 added cin.get() after getline Chapter 9 Fig. 9.01-2 added two cin.get()s after getlines Fig. 9.03-4 to Query.cpp - added two cin.get()s to virusScanSim.cpp - added one cin.get(), one inStream.get() Fig. 9.11-12 had to add #include to Sphere.h Chapter 10 CaseStudy 10.08 compiles, links and runs, but gives 4 warnings. Fig. 10.01 to Query.cpp added two cin.get()s Fig. 10.02 added using namespace std; Fig. 10.03 produces 4 warnings, but still runs okay (same warnings as CaseStudy 10.08) Fig. 10.07-12 to DataSet.cpp - added one fin.get() to meanAndMedian.cpp - added one cin.get() Chapter 11 Fig. 11.02-12 added default cases to the switch statements in the following functions: inFahrenheit(), inCelsius(), inKelvin() - in Temperature.cpp Fig. 11.19,21,23 added default cases as above Chapter 12 Fig. 12.20-23 Error in 1st printing of text: Change #include "Color.h" to #include "Colors.h" Chapter 13 Fig. 13.07, 13.09, 13.11: The following are the main changes made to use CartesianSystem with CMU Graphics 1.5 for Visual C++ 6.0 (Service Pack 5). There are probably some others that I'm forgetting, but these were the major ones. - #include had to be added in most files - The 127Graphics.h library was nowhere to be found, so references to it and do_console() had to be removed. - The file colors.h had to be #included, and in all functions using an int parameter for a color, the parameter type had to be changed to type "color" (the new class for such). A couple of the color-identifiers no longer existed: DKGREEN had become DARKGREEN, and AQUA had become AQUAMARINE. - References to Graphics.h had to be replaced by references to CMUGraphics.h - Loop control variables declared in and used in multiple for loops had to be declared outside of the loop to avoid the erroneous redeclaration error - References to std::round() failed to link, and had to be replaced by a home-grown round() function. - When compiling CartesianSystem.cpp, VC++ generated an erroneous compilation error for the definition corresponding to: void drawFunction(FunctionOfX aFunction, color aColor = BLACK); with the typedef type FunctionOfX being the source of the problem. To fix this, I replaced the declaration and definition with the ugly-but-equivalent syntax from the typedef: void drawFunction(double (*aFunction)(double), color aColor = BLACK); Chapter 15 Fig. 15.02 Error in 1st printing of text: Must add #include Fig. 15.05-7 Two warnings, but executes correctly Fig. 15.8 Added fin.get(); after fin.getline(); in DecisionTree.cpp Fig. 15-STLtrees.01 gives many warnings (but works okay); added one cin.get() Fig. 15-STLtrees.02 gives several warnings; changed second declaration of it to it2 because of Visual's non-standard scope rule re identifiers declared in the heading of a for loop