How can I concatenate upper and lower nibbles stored sequentially in an array?
- by Abhijit Kumar
Hi friends,
I have an array which contains a list of nibbles:
{0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, ...}
I want to combine adjacent nibbles into single bytes by left-shifting the upper nibble and concatenating it with the lower one. The output should look as follows:
{0xab, 0xcd, 0xef, ...}
How can I accomplish this in C?