Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) std::showpos

 

std::showpos is a stream modifier to prepend positive values by a plus.

 

#include <iostream>

int main()
{
  const int i = 1;
  std::cout
    << std::showpos   << i << '\n'
    << std::noshowpos << i << '\n';
}

 

Screen output:

 

+1
1

 

 

 

 

 

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

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict