I read in this way, where file my object of the <ifstream> class, the loop will go into an invalid state, if I catch the symbol, how to read everything from the file that matches the type, and not get a stake?

  int n, count = 0; while (file >> n) { ++count; } 

Py.Sy. If the number in the file is larger than the size of the inta, how to get around it? That is also not read.

  • ru.stackoverflow.com/questions/454210/… I think. What is in question Linux - do not look. - pavel
  • @pavel, check in the nested every character from the stream? - LokenGarvel '
  • No, read as read, if an error occurred, perform these actions and continue. - pavel
  • @LokenGarvel ', ofstream or still ifstream? - Denis Scherbakov
  • @DenSDS, ifstream) - LokenGarvel '

0