Whenever I run the program, there is an error in opening the input file. I'm not quite sure where I went wrong.
Text2.txt:
2345.45667
-0.0000456
34.9999
0.006788
-1.2345
The problem with this approach is when you open the input file the file pointer is at the beginning.
Then you open the output file in append mode and the file pointer is at the end.
How can you read from it ?
One possible solution would be to read all the numbers into a vector first, close the input, open the output and write all the numbers from the vector.