Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) std::setiosflags

 

std::setiosflags (an abbreviation of 'set input/output stream flags') is a stream modifier.

 

#include <iomanip>
#include <iostream>

int main()
{
  const double x = 12.34;
  std::cout
    << std::setiosflags(std::ios::scientific)
    << x << '\n'
    << std::setiosflags(std::ios::fixed)
    << x << '\n';
}

 

Screen output:

 

1.234000e+01
12.34

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict