iomanip - STL C++

resetiosflags()

Declaration

(unspecified) resetiosflags(ios_base::fmtflags qResetFlags);

Description

This is the resetiosflags() function for output stream manipulation. The argument qResetFlags specifies the output formatting flags that are to be reset.

Header Include

#include <iomanip>

Example

#include <iostream>
#include <iomanip>

int main() {
	using namespace std;

	double dNumber = 9287.343535;
	// Output the value with default settings
	cout << "Default: " << dNumber << endl;

	// Output the value with in scientific notation
	cout << setiosflags(ios_base::scientific);
	cout << "Scientific notation: " << dNumber << endl;

	// Reset the scientific notation flag
	cout << resetiosflags(ios_base::scientific);
	cout << "Reset: " << dNumber << endl;

	// Keep the window open
	cin.get();
	return 0;
}

Output

resetiosflags() Output
 

© 2007–2024 XoaX.net LLC. All rights reserved.