I would like to convert a uint32
to a char
string for printing purposes. My uint32
is an address that looks something like "0x00402B00
"
I could care less about the preceding "0x
", but it doesn't matter if it's in there.
How can I turn this number into a char
string where:
string[0] = 0
string[1] = 0
string[2] = 4
string[3] = 0
string[4] = 2
....and so on.
Will something like this work?:
uint32 address = 0x00402b00;
char string[8];
sprintf(string, '%u', address);
Any ideas?