Suppose input.txt- 1 byte text file:
std::ifstream fin("input.txt", std::ios::in);
fin.get();
fin.get();
std::cout << fin.eof();
fin.unget();
std::cout << fin.eof();
fin.get();
std::cout << fin.eof();
It seems like unget()breaks eoffires a flag and it breaks pointers to files. Am I doing something wrong?
Ivars source
share