1、问题描述
crc32校验之后,是个int型的数据,怎么将数据填入一个char型的buff中,
int crc32;
char buff[4];
buff[0] = (crc32>>24) & (0x000000ff);
buff[1] = (crc32>>16) & (0x000000ff);
buff[2] = (crc32>>8) & (0x000000ff);
buff[3] = (crc32>>0) & (0x000000ff);
int类型占有4个字节,共有32位,所以对位进行操作的时候,注意位数的多少。