I have a simple program :
#include <stdio.h>
int main()
{
long i = 16843009;
printf ("%02x \n" ,i);
}
I am using %02x
format specifier to get 2 char output,
However, the output I am getting is:
1010101
while I am expecting it to be :01010101
.
Your string is wider than your format width of 2. So there's no padding to be done.