printf() formatting for hexadecimal

Why, when printing a number in hexadecimal as an 8 digit number with leading zeros, does %#08X not display the same result as 0x%08X?

When I try to use the former, the 08 formatting flag is removed, and it doesn’t work with just 8.

Leave a Comment