Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) std::uppercase

 

std::uppercase is a stream manipulator: when a number's base and/or non-decimal digits are show, std::uppercase displays these in uppercase.

 

#include <iostream>

int main()
{
  const int x = 255; //0xFF
  std::cout
    << std::showbase
    << std::hex
    << std::uppercase   << x << '\n'
    << std::nouppercase << x << '\n';
}

 

Screen output:

 

0XFF
0xff

 

 

 

 

 

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

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict