Hi
I'm looking for a way to take two uint8_t values and place them in a Uint16_t...
The end result being:Code:uint8_t bob 0xDD; uint8_t fred 0xFF; uint16_t tom; tom = ???
Tom: 0xDDFF
Has any one got any ideas?
Cheers
David
Hi
I'm looking for a way to take two uint8_t values and place them in a Uint16_t...
The end result being:Code:uint8_t bob 0xDD; uint8_t fred 0xFF; uint16_t tom; tom = ???
Tom: 0xDDFF
Has any one got any ideas?
Cheers
David
tom = bob;
tom <<= 8;
tom |= fred ;
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler