hello i have an array of 3 bytes unsgined char and i want to convert the 3 byte (hex) array to 1 byte (hex value). values in the array are between 0 - 9 only.
unsigned char buf[3], output; buf[0] = 0x01; buf[0] = 0x02; buf[0] = 0x03;
i want an output as follow: 123 in HEX => output = 0x7B
i tried 'sscanf' and i haven't succeeded. please help.
From his example soruce, you can see that he means the numeric value 2, not the ASCII character 2.
Byt three bytes with the range 0..9 in them can still form any value up to 999 which is almost four times the capacity of a single byte.