Bác nào biết cách cắt một số 16bit thành 2 số 8bit chứa byte cao và byte thấp của số 16bit bẳng ngôn nhữ C chỉ em fát . Em xin đa tạ very much
![41](http://dientuvietnam.net/forums/images/smilies/41.gif)
unsigned int test = 0xABCD;
unsigned char idata *a, byte_cao, byte_thap;
a = &test;
byte_cao = *a;
byte_thap = *(a+1);
j=k&0xff;//lấy byte thấp
i=(k>>8)&0xff;//lấy byte cao
Comment