Q:

What does the (-) sign do in 'printf("%-x", 2048);'?

I found this question:
What is the output of printf("%-x", 2048);?
I know that the "%x" is outputting the hexadecimal format of the number, but I can' quite understand what the minus sign does here, since the output is the same for both printf("%-x", 2048); and printf("%x", 2048);.

A:

std::printf, std::fprintf, std::sprintf, std::snprintf:

-: the result of the conversion is left-justified within the field (by default it is right-justified)

