共用方式為


ios_base::iostate

描述資料流的來源狀態常數的型別。

namespace std {
   class ios_base {
   public:
      typedef implementation-defined-bitmask-type iostate;
      static const iostate badbit;
      static const iostate eofbit;
      static const iostate failbit;
      static const iostate goodbit;
      ...
   };
}

備註

這個型別是描述物件可以儲存資料流狀態資訊的位元遮罩型別。 不同旗標值 (項目) 是:

  • badbit,會記錄資料流緩衝區的完整性遺失。

  • eofbit,記錄檔案結尾,當擷取自資料流。

  • failbit,記錄檔會從資料流擷取有效的欄位。

此外,有用的值是 goodbit,先前提到的位元都未設定 (goodbit 一定是零)。

需求

標題: <ios>

命名空間: std

請參閱

參考

ios_base 類別

iostream 程式設計

iostreams 慣例