Example: 1011 + 1001 = 10111001
UPD: wrong with an example, of course, like this 00001011 + 00001001 = 0000101100001001
Example: 1011 + 1001 = 10111001
UPD: wrong with an example, of course, like this 00001011 + 00001001 = 0000101100001001
unsigned char a = …; unsigned char b = …; unsigned int result = (a << 8) | b;
unsigned char a = ...; unsigned char b = ...; unsigned short c = ((unsigned short)a << 8) | b;
Source: https://ru.stackoverflow.com/questions/293950/
All Articles