cout unset: clear flag : cout sync clear « Console « C++






cout unset: clear flag

cout unset: clear flag

#include <iostream>
using namespace std;

int main()
{
  cout << 100 << ' ';

  cout.unsetf(ios::dec); // clear dec flag
  cout.setf(ios::hex);
  cout << 100 << ' ';

  cout.unsetf(ios::hex); // clear hex flag
  cout.setf(ios::oct);
  cout << 100 << '\n';

  return 0;
}

           
       








Related examples in the same category

1.cout: Clears the buffer and resets any error flags that may be setcout: Clears the buffer and resets any error flags that may be set