I'm basically working with fragments of a text file like this:
6
Jane Doe
1942
90089
3 1 5 12
There are tabs on lines 2-5. I'm trying to hold each of the values in an appropriate variable and I would like to have the numbers on the bottom line stored in a vector called friends, e.g. <3, 1, 5, 12>. There can be an arbitrary number of numbers on the last line. I also don't know if I'm missing anything with how ifstream processes tabs.
Here's what I have so far:
int id;
ifile >> id;
string name;
getline(ifile, name);
int year;
ifile >> year;
int zip;
ifile >> zip;
vector<int> friends;
// Not sure how to read in the vector if it has an arbitary length
// Use getline and somehow read everything in from the string?
How would I approach the vector? While loop?