diff options
| -rw-r--r-- | CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp index a588228..5d802b0 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp @@ -63,6 +63,7 @@ using std::cout; using std::endl; using std::setw; using std::ios; +using std::string; using std::ifstream; using std::ofstream; @@ -70,6 +71,9 @@ using std::ofstream; const int EMPLOYEES = 20; const int MAX = 21; +string OutFileName = "C:\\TEMP\\Chap_11_ReportOut.txt"; +string InFileName = "C:\\TEMP\\Chap_11_Report.txt"; + int ReadData(ifstream& inFile, ofstream& outFile, char name[][MAX], int age[]); void WriteOutputFile(ofstream& outFile, char name[][MAX], int age[], int counter); @@ -84,9 +88,9 @@ int main() ifstream inFile; // Notice how this automatically opens the file - ofstream outFile("C:\\TEMP\\Chap_11_ReportOut.txt"); //changed output file to be seperate. + ofstream outFile(OutFileName); //changed output file to be seperate. - inFile.open("C:\\TEMP\\Chap_11_Report.txt"); + inFile.open(InFileName); if (inFile.is_open()) { @@ -101,13 +105,13 @@ int main() } else { - cout << "Trouble Opening File"; + cout << "Trouble Opening: " << OutFileName; cout << "\n\n\t\t ** About to EXIT NOW! ** "; } } else { - cout << "Trouble Opening File"; + cout << "Trouble Opening: " << InFileName; cout << "\n\n\t\t ** About to EXIT NOW! ** "; } return 0; |