Say I had an array full of hex numbers that I wanted to print. If I just went ahead and printed them out one by one in a for loop like this:
then the following might be displayedCode:for (a = 1; a<= 31; a++) { printf("%x\n",array[a]); }
ffff0000
0
0
0
7fffef4c
7fffef50
0
14
19
0
0
0
0
0
0
0
c
8
fffffffb
0
0
0
0
0
0
0
0
10008000
7fffef48
0
400018
My question is, how can I best edit the above code to make the program display each value as the same size (8 characters).
Basically extended to the left by 0s if they aren't already 8 long.
so like:
ffff0000
00000000
00000000
00000000
7fffef4c
...
so on
Thanks