当我以二进制模式打开文件时,是否存在is_open()
is true
but good()
is的情况false
?
bool ok = false;
std::ifstream stream("test.dat", std::ios::binary)
if (stream.is_open())
{
ok = stream.good();//Does a situation exist where the result of this is false ?
stream.close();
}