if(a.fail())
if(!a.good())
if(!a)
(1) fstream::fail
true if either the badbit or the failbit is set
bool fail() const
{ return (this->rdstate() & (badbit | failbit)) != 0; }
(2) fstream::good
true if no error flags are set
bool good() const
{ return this->rdstate() == 0; }
最后欢迎大家访问我的个人网站: 1024s