I have an array of unsigned chars with hex values and I need to make a string of them. So when I have arr[0]=2b
and arr[1]=fc
I want to be able to make a string s="2bfc"
, not the characters from ascii codes. How can I do that?
Asked
Active
Viewed 154 times
-4

M-guy
- 1
- 1
-
1problem decomposition + googling = skill – LogicStuff Jan 15 '17 at 14:17
-
`0x2B12` is too large to be an `unsigned char` which is one byte or `0-255` in decimal or `0-FF` in hex. Your welcome. – marshal craft Jan 15 '17 at 14:18
-
yup, I changed it – M-guy Jan 15 '17 at 14:22
1 Answers
0
You could change to long or int and loop through adding +arr[ArrayIndex]*0x10^ArrayIndex
to get one int representation of it using itoa()
, then convert the int to a literal string of it. Just to outline a manual process of doing it.

marshal craft
- 439
- 5
- 18