1:iostate rdstate ( ) const; 返回的是iostate,简单的说也就是一个int数值.用2进制数据的某一个位置设置为1表示一种状态
2:failbit 的定义如下,二进制数据的第二位为1的时候说明是该数据。
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/bianchengyuyan/)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。
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/bianchengyuyan/)