diff options
| author | Andrei F <[email protected]> | 2022-11-01 22:43:05 -0700 |
|---|---|---|
| committer | Andrei F <[email protected]> | 2022-11-01 22:43:05 -0700 |
| commit | d7255207489f27b9e4b7d526512e9e4bca027b96 (patch) | |
| tree | 66ad95eb14957f2b4c4a78196516d45281d1e182 /CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp | |
| parent | Working through first part (diff) | |
| download | cst116-ch11-debugging-florea-d7255207489f27b9e4b7d526512e9e4bca027b96.tar.xz cst116-ch11-debugging-florea-d7255207489f27b9e4b7d526512e9e4bca027b96.zip | |
Finished part 1
Diffstat (limited to 'CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp')
| -rw-r--r-- | CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp index 84e77eb..ba5ea16 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp @@ -31,9 +31,16 @@ * and notice how Visual Studio has rewritten your output file * and asks if you would like to reload the file (select Yes). * 9) Examine the contents of both the input and the output file. + +There is an additional line of what seems to be additional memory. + * 10) Fix all the problems in your code that exist in relation to * the output. Verify that your output is appropriate for your input file. + +Done, there was an issue in the for loop, as the index started at 0, +but it went one over than what it was supposed to. + * 11) Build and execute your code until you have all errors * removed and all the output is correct. * @@ -135,7 +142,7 @@ int ReadData(ifstream& inFile, ofstream& outFile, char name[][MAX], int age[]) void WriteOutputFile(ofstream& outFile, char name[][MAX], int age[], int counter) { outFile << " Here is the Output File" << endl; - for (int r = 0; r <= counter; r++) + for (int r = 0; r < counter; r++) { outFile << setiosflags(ios::left) << setw(25) << name[r] << setw(4) |