I have this function to read in all ints from the file. The problem is when i read letters i trigger a new line and i always seek by 1 and not to the end of line. How can i write this function better?
int v;
while (!in.eof())
{
while (in >> v)
cout << v << " ";
cout << endl;
if (in.eof())
break;
in.clear();
in.seekg(1, ios::cur);
int a;
a=0;
}