cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : IOstream Library : ios_base : unsetf
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forum
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
IOstream Library
manipulators
classes:
· filebuf
· fstream
· ifstream
· ios
· iostream
· ios_base
· istream
· istringstream
· ofstream
· ostream
· ostringstream
· streambuf
· stringbuf
· stringstream
objects:
· cerr
· cin
· clog
· cout
types:
· fpos
· streamoff
· streampos
· streamsize
ios_base
· ios_base::ios_base
· ios_base::~ios_base
member classes:
· ios_base::failure
· ios_base::Init
member functions:
· ios_base::flags
· ios_base::getloc
· ios_base::imbue
· ios_base::iword
· ios_base::precision
· ios_base::pword
· ios_base::register_call...
· ios_base::setf
· ios_base::sync_with_stdio
· ios_base::unsetf
· ios_base::width
· ios_base::xalloc
member types:
· ios_base::event
· ios_base::event_callback
· ios_base::fmtflags
· ios_base::iostate
· ios_base::openmode
· ios_base::seekdir

-

ios_base::unsetf public member function
void unsetf ( fmtflags mask );

Clear specific format flags

Clears the format flags corresponding to the bits set in parameter mask.

The parameterized manipulator resetiosflags behaves in a similar way as this member function.

Parameters

mask
Bitmask specifying the flags to be cleared. The flags are specified as a combination of flags of the member type fmtflags.

Return Value

none

Example

// clearing flags
#include <iostream>
using namespace std;

int main () {
  cout.setf ( ios_base::hex, ios_base::basefield );  // set hex as the basefield
  cout.setf ( ios_base::showbase );                  // activate showbase
  cout << 100 << endl;
  cout.unsetf ( ios_base::showbase );                // deactivate showbase
  cout << 100 << endl;
  return 0;
}

The execution of this example displays something similar to:


0x64
64

See also

ios_base::flags Get/set format flags (public member function)
ios_base::setf Set specific format flags (public member function)
ios_base::fmtflags Type for stream format flags (public member type)
resetiosflags Reset format flags (manipulator function)

© The C++ Resources Network, 2000-2007 - All rights reserved
Spotted an error? - contact us