Please take a look at the code listed below:

const char *cszFilePath = "TestFile";
ofstream ofs;
ofs.open(cszFilePath, ios_base:ut | ios_base::binary);
int iSize = 3;
ofs.write((char *)&iSize, sizeof(int));
ofs.close();

ifstream ifs;
ifs.open(cszFilePath, ios_base::in | ios_base::binary);
int iTemp;
ifs.read((char *)&iTemp, sizeof(int));
bool bEOF = ifs.eof();

Since there is only one integer in the file "TestFile", after reading a integer from the input file stream, bEOF should be true here, but actually its value is FALSE!
Who can explain this to me? Thank you very much for your help!