1:iostate rdstate ( ) const; 返回的是iostate,簡單的說也就是一個int數值.用2進制數據的某一個位置設置為1表示一種狀態
2:failbit 的定義如下,二進制數據的第二位為1的時候說明是該數據。
static const _Iostate goodbit = (_Iostate)0x0; static const _Iostate eofbit = (_Iostate)0x1; static const _Iostate failbit = (_Iostate)0x2; static const _Iostate badbit = (_Iostate)0x4; static const _Iostate _Hardfail = (_Iostate)0x10;
3:input.rdstate() & std::ios::failbit 通過位運算的與來判斷當前的狀態是否是failbit。