Let's say I have a .in file with the first line of data "3 59 98" and the second line of data "8 52 77 45".
I'm trying to read each line of integers into a list. I already understand how to make a list and put numbers in the list. What I am having trouble with is how to get the first line of numbers into a list object.
the following is an idea of what I have so far:
// in is a filestream object
int a
while (in >> a)
{
integer_list.push_back(a);
}
I know this doesn't work because it puts both lines of numbers into one list.
Any suggestions?