int类型转换为byte
#define byte unsigned char
static void intToByte(int i,byte *bytes)
{
//byte[] bytes = new byte[4];
int size = 4;
memset(bytes,0,sizeof(byte) * size);
bytes[3] = (byte) (0xff & i);
bytes[2] = (byte) ((0xff00 & i) >> 8);
bytes[1] = (byte) ((0xff0000 & i) >> 16);
bytes[0] = (byte) ((0xff000000 & i) >> 24);
printf("intToByte %2x",bytes[3]);
}