I have a file that contains different columns in different lines. For example
10 20 30 60
60 20 90 100 40 80
20 50 60 30 90
....
I want to read the last three numbers in each row. So the output will be
20 30 60
100 40 80
60 30 90
I can not use the following structures because of variable size in each line
structure 1:
std::ifstream fin ("data.txt");
while (fin >> a >> b >> c) {...}
structure 2:
string line;
stringstream ss;
getline(fin, line);
ss << line;
int x, y, z;
ss >> x >> y >> z >> line;
What should I do then?