Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ofstreams を使用したファイルへの書き込みで奇妙な問題が発生しており、現在は
ofstream.fail()
ofstream.open() 呼び出しの直後に true を返しています。
失敗状態が設定された理由の詳細など、追加情報を取得する方法はありますか?
編集、追加情報: is_open() は false を返します。
同じ状況を見つけたので、読んだタイプミスを解決しました
if (!outfile.is_open());
{
}
if ステートメントの後のセミコロンに気付かない...
io_state word=ofstream.rdstate(); if(word & ios::failbit){ cout<<"Failbit flag is set"; } //etc