与主题一样,当我执行以下代码时,.rdstate() 返回值 2。我做错了什么?
string logger_path_and_name("\"F:\\windowsqnx\\loggs\\logger_file.dat");
/* file to store simulation data */
std::ofstream fout( logger_path_and_name.c_str(), std::ios_base::out | std::ios_base::binary);
/* check if ios::binary supported */
if (!fout.is_open())
{
std::cerr << "can't create file logger_file.dat\n";
std::cerr << fout.rdstate();
system("PAUSE");
exit(EXIT_FAILURE);
}