运算符优先级问题
1、gDCBus_Voltage = ( (pCommBuffer->ReceiveBuffer[3] << 8) + pCommBuffer->ReceiveBuffer[2])*f32Coeff;
2、gDCBus_Voltage = ( pCommBuffer->ReceiveBuffer[3] << 8 + pCommBuffer->ReceiveBuffer[2])*f32Coeff;
写法1是正确的
写法2是不对的,因为移位运算符的优先级比 +这个运算符的优先级低。