C++ iomanip resetiosflags() Function
Example
Turn the fixed flag on, and then off again:
cout << fixed << setprecision(2) << 3.14159 << "\n";
cout << resetiosflags(ios::fixed) << 3.14159;
Definition and Usage
The resetiosflags() function turns off one or more format flags for the output.
In the example, fixed is turned off, so setprecision(2) means 2 digits in total, not 2 decimals.
The resetiosflags function is defined in the <iomanip> header file.
Syntax
resetiosflags(ios::fmtflags flags)
Parameter Values
| Parameter | Description |
|---|---|
| flags | Required. The flags to turn off, like ios::fixed or ios::left. Combine several flags with |. |
Technical Details
| Returns: | A manipulator that you use with <<. |
|---|