Mega Code Archive

 
Categories / C++ Tutorial / Data Types
 

Show the base in hexadecimal

#include <iostream> #include <iomanip> #include <string> #include <sstream> using namespace std; int main( ) {   stringstream ss;   ss << showbase << hex << 16; // Show the base in hexadecimal   cout << ss.str( ) << endl; } 0x10