Convert Bytes to Int / uint in C

前端 未结 4 1811
不知归路
不知归路 2020-11-27 05:17

I have a unsigned char array[248]; filled with bytes. Like 2F AF FF 00 EB AB CD EF ..... This Array is my Byte Stream which I store my Data from the UART (RS232) as a Buffer

4条回答
  •  感动是毒
    2020-11-27 05:39

    In case of little-endian, can't you just use memcpy?

    memcpy((char*)&myint1, aesData.inputData[startindex], length);
    

提交回复
热议问题