why do you need to sum the 2 values and then bit shift it 8 places?
The order of operator precedence in C/C++ is to shift first, then OR.
When in doubt, or for clarity, use parentheses.
int value = x_low | (x_high<<8);
why do you need to sum the 2 values and then bit shift it 8 places?
The order of operator precedence in C/C++ is to shift first, then OR.
When in doubt, or for clarity, use parentheses.
int value = x_low | (x_high<<8);