My input file loos like (20 lines in total)
What I want to make looks like
In other words, I want to extract multiple lines from text file into a single string.
The below is what I have tried. But it does not work.
Would you please give me a tip about my probelm?
Well, the getline will fail when the end of file is reached, but the for loop continues without checking.
Having said that, it seems to work, providing the input doesn't have more lines than the array.