diff options
| author | alexandra-apetroaei <andra@MSI> | 2022-11-02 22:15:53 -0800 |
|---|---|---|
| committer | alexandra-apetroaei <andra@MSI> | 2022-11-02 22:15:53 -0800 |
| commit | 8394a57a5aa1612663d8245d8bd7fbc7f3b093d5 (patch) | |
| tree | 816b4857c6446ba4dac3e2f568025b1b27a28840 /CST116-Ch11-Debugging | |
| parent | change (diff) | |
| download | cst116-ch11-debugging-alexandra-apetroaei-8394a57a5aa1612663d8245d8bd7fbc7f3b093d5.tar.xz cst116-ch11-debugging-alexandra-apetroaei-8394a57a5aa1612663d8245d8bd7fbc7f3b093d5.zip | |
change
Diffstat (limited to 'CST116-Ch11-Debugging')
| -rw-r--r-- | CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp | 9 | ||||
| -rw-r--r-- | CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj | 3 | ||||
| -rw-r--r-- | CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters | 3 |
3 files changed, 8 insertions, 7 deletions
diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp index a0295db..ffbcaa4 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.cpp @@ -68,8 +68,10 @@ const int EMPLOYEES = 20; const int MAX = 21; int ReadData(ifstream& inFile, ofstream& outFile, char name[][MAX], int age[]); + void WriteOutputFile(ofstream& outFile, char name[][MAX], int age[], int counter); + void PrintTotalsAndSummary(ofstream& out, int totalRecords); int main() @@ -78,12 +80,13 @@ int main() int age[EMPLOYEES]; int record_counter(0); - ifstream inFile("C:\\TEMP\\Chap_11_Report.txt"); + ifstream inFile; // Notice how this automatically opens the file - ofstream outFile; + ofstream outFile("C:\\TEMP\\names.txt"); + + inFile.open("C:\\TEMP\\names.txt"); - inFile.open("C:\\TEMP\\Chap_11_data.txt"); if (inFile.is_open()) { diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj index 05b57a1..0cbd5a6 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj @@ -130,8 +130,7 @@ <ClCompile Include="CST116-Ch11-Debugging.cpp" /> </ItemGroup> <ItemGroup> - <Text Include="..\TEMP\Chap_11_Report.txt" /> - <Text Include="TEMP\Chap_11_data.txt" /> + <Text Include="..\TEMP\names.txt" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> diff --git a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters index d1bbc46..43b6186 100644 --- a/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters +++ b/CST116-Ch11-Debugging/CST116-Ch11-Debugging.vcxproj.filters @@ -20,7 +20,6 @@ </ClCompile> </ItemGroup> <ItemGroup> - <Text Include="TEMP\Chap_11_data.txt" /> - <Text Include="..\TEMP\Chap_11_Report.txt" /> + <Text Include="..\TEMP\names.txt" /> </ItemGroup> </Project>
\ No newline at end of file |