Analysis based on the definition of flow state in ios

  • 2020-04-01 21:39:22
  • OfStack

1: iostate rdstate () const; Iostate is returned, which is simply an int. A position of 2 base data set to 1 indicates a state

2: the definition of failbit is as follows: the second digit of binary data is 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  The sum of bits is used to determine whether the current state is failbit.


Related articles: