summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp13
-rw-r--r--CST116-Ch11-Debugging/repor.txt0
2 files changed, 9 insertions, 4 deletions
diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp
index 23be1a4..e8e54d8 100644
--- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp
+++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp
@@ -55,11 +55,13 @@
#include <iostream>
#include <fstream> // For the files!!!!
#include <iomanip> // For manipulators & formatting options
+#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::setw;
using std::ios;
+using std::string;
using std::ifstream;
using std::ofstream;
@@ -67,6 +69,9 @@ using std::ofstream;
const int EMPLOYEES = 20;
const int MAX = 21;
+const string inPath = "dat.txt";
+const string outPath = "repor.txt";
+
int ReadData(ifstream& inFile, ofstream& outFile, char name[][MAX], int age[]);
void WriteOutputFile(ofstream& outFile, char name[][MAX], int age[],
int counter);
@@ -81,9 +86,9 @@ int main()
ifstream inFile;
// Notice how this automatically opens the file
- ofstream outFile("repor.txt");
+ ofstream outFile(outPath);
- inFile.open("dat.txt");
+ inFile.open(inPath);
if (inFile.is_open())
{
@@ -98,13 +103,13 @@ int main()
}
else
{
- cout << "Trouble Opening File";
+ cout << "Trouble Opening " << outPath;
cout << "\n\n\t\t ** About to EXIT NOW! ** ";
}
}
else
{
- cout << "Trouble Opening File";
+ cout << "Trouble Opening " << inPath;
cout << "\n\n\t\t ** About to EXIT NOW! ** ";
}
return 0;
diff --git a/CST116-Ch11-Debugging/repor.txt b/CST116-Ch11-Debugging/repor.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/CST116-Ch11-Debugging/repor.txt