I am trying to read a text file that looks something like this:
0 5 9
0 4 15
1 3 5
2 15 4
11 3 2
15 15 16
end99
The total number of integers before end99 are unknown. But when it gets to end99, the program puts all the individual integers into an array before end99 and then terminates. In the end, the program produces {0,5,9,0,4,15,1,3,5,2,15,4,11,3,2,15,15,16}
I don't know if I should use int, char, or getline to read each value before end99. If I use int, I won't be able to know when I get to end99. If I use char, there will be a problem reading the integers. If I use getline, I don't know how to put the individual integers into an array.
Any ideas would be greatly appreciated. If you are confused about my question, I would be more than happy to clarify.