Reputation: 23
I have a hex value stored in a two byte array :
unsigned char hex[2] = {0x84, 0xA5};
How can I convert only first element of an array to a decimal value, i.e hex[0] to int ?
Upvotes: 0
Views: 264
Reputation: 70931
Just assign it:
int i = hex[0];
Upvotes: 1