I want to format an unsigned int to an 8 digit long string with leading zeroes.
This is what I have so far:
unsigned int number = 260291273;
char output[9];
sprintf(output, "%x", number);
printf("%s\n", output); // or write it into a file with fputs
Prints "f83bac9", but I want "0f83bac9". How can I achieve the formatting?