I have array of chars:
char macChars=[12];
The content of it is e.g. macChars[0]=53, macChars[1]=66 …
I need to convert these numbers to hex chars, so i would have another array:
macCharsHex[0]=5 //value 53 in hex
macCharsHex[1]=B //value 66 in hex
Thank you.
They are already converted, since character in C are represented by their corresponding character codes.
Therefore, as far as storing things in arrays is concerned there is nothing you need to do and if you want “5” and “B” to show up correctly when printing or doing something like that its a matter of using the correct printing function (putchar, printf with %c, etc).