I have a text file containing numbers seperated by spaces. The numbers are written in rows. I want C++ to read the numbers and print them in a single column, i.e.
from "input.txt": 1.1 2.2 3.3
to:
1.1
2.2
3.3
So far I can only print the numbers in a row with the code below. Thank you very much. Kind regards, Chris
Thank you very much! It works fine. Only problem is that the last number given in "input.txt" appears twice in the output. I will try to fix this. The adapted code is given below. Thanks! Cheers, Chris.