1
所以我一直在嘗試從一個數組中移位2個字節,我有時候會以很好的值結束,但並不是所有的時間。所以這裏是一個例子。在數組c中移位2字節
char buffer[2]; //current character buffer to store the bytes
unsigned int number; //the unsigned int to store values
number = buffer[0] << 8 | buffer[1]; //bitshifting
printf("%02x ", number);
我似乎在某些情況下得到了這個。
ffffffbc // the bc seems to be correct however the f's are not