Why is ifstream returning the last value of strings twice?
in
size_t c;
while (1){
myfile >> c;
cells.push_back(c);
if (myfile.eof()) break;
}
for (int i = 0; i < cells.size(); i++) cout << cells[i] << endl;
with the input
2 3
9 7 11
12 5 6
3 4
cells[7] = cells[8] = 4
I've done this with a few similarly formatted inputs and it does this for all of them.