Below i have attached my current project for class and it is compiling fine, it just won't open the txt file titled "in06.txt". I have created the txt file. I am currently in a project that takes the txt file and uses those numbers to make a running count, minimum value, maximum value, and the average of every number on each line separately. After it calculates that, it needs to be set into an output file. Help would be greatly appreciated! Thanks!
The ; should not be there. That causes the if statement to be a no-op.
Therefore the following cout and exit are executed unconditionally.
You have the same problem with line 19.
Also what happens is there is no new line character in your file?
And in C++ programs you should not use the exit() function except in very rare cases. This C function doesn't properly call C++ class destructors which can cause problems.
Thanks. Unfortunately i am having another problem with the program. It doesn't correctly keep track of the count, minimum or average. With in06.txt, i entered 1 2 3 2 1. In the output file it createts count: 671664133 min: 0 average: 0