(C++) std::uppercase

February 24, 2017 · View on GitHub

 

 

 

 

 

(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

 

 

 

 

 

 

Contents

  1. 1int main() { const int x = 255; //0xFF std::cout #include &#x3C;iostream> int main() { const int x = 255; //0xFF std::cout &#x3C;&#x3C; std::showbase &#x3C;&#x3C; std::hex &#x3C;&#x3C; std::uppercase &#x3C;&#x3C; x &#x3C;&#x3C; '\n' &#x3C;&#x3C; std::nouppercase &#x3C;&#x3C; x &#x3C;&#x3C; '\n'; }
  2. 20XFF 0xff