Hi, im using visual studio 2010, and for my recent assignment i am having difficulty when closing a text file. My program is to read in the data from a text file and then do some calculations and then output the result.
My text file Measurements.txt looks like this:
5
11
4
3
6
7
4
2
Each set of 4 numbers represents miles, yards, feet, and inches. For example, 5 miles, 11 yards, 4 feet, and 3 inches are the first four, then the second four is the second set of data. My problem is that when i try to close the text file, it only reads the first set of data and computations, then an error occurs that stops it from running. I've tried using a for loop to try and loop the data just 2 times, but that doesnt seem to work. Any suggestions?