M
Marcus Kwok
When outputting an integer as hexadecimal, is it possible to set the
stream so that the basefield is lowercase, but the values are uppercase?
For example:
#include <iostream>
int main()
{
using std::cout;
using std::hex;
using std::showbase;
using std::uppercase;
int i = 42;
cout << i << '\n';
cout << hex << showbase << i << '\n';
cout << uppercase << i << '\n';
}
The output is:
42
0x2a
0X2A
However, I would like to have the output format be like:
0x2A
stream so that the basefield is lowercase, but the values are uppercase?
For example:
#include <iostream>
int main()
{
using std::cout;
using std::hex;
using std::showbase;
using std::uppercase;
int i = 42;
cout << i << '\n';
cout << hex << showbase << i << '\n';
cout << uppercase << i << '\n';
}
The output is:
42
0x2a
0X2A
However, I would like to have the output format be like:
0x2A