c++ - What does it mean by setting the failbit/badbit/eofbit? -


what mean "setting failbit" - can infer underlying code failbit set (it non-zero) before when error occurs - on passing input t value of failbit still remains same - why remains same before

    `     #include <iostream>     using namespace std;      int main()     {      int i;          if(cin.good())          {               cout<<"all good"<<endl;               cout<<"rdstate: "<<cin.rdstate()<<" failbit: ".                  <<cin.failbit<<endl;           }           cin>>i;            while(cin.fail())           {                cout<<"failed"<<endl;                cout<<"rdstate: "<<cin.rdstate()<<" failbit: ".                     <<cin.failbit<<endl;                break;            }        return 0;      } 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

Python Tornado package error when running server -