Is it possible to make ostream output hexadecimal numbers with characters A-F and not a-f?
int x = 0xABC;
std::cout << std::hex << x << std::endl;
This outputs abc whereas I would prefer to see ABC.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you can use
std::uppercase, which affects floating point and hexadecimal integer output:as in the following complete program:
which outputs: