\u003ccode\u003eunsigned char a, b, c, d; \nunsigned int result; \n\n// 将a移位到最高位 \nresult = a \u003c\u003c 24; \n\n// 将b移位到次高位 \nresult |= b \u003c\u003c 16; \n\n// 将c移位到次低位 \nresult |= c \u003c\u003c 8; \n\n// 将d存储到最低位 \nresult |= d; \n\u003c/code\u003e

将4个unsigned char数据存储到一个unsigned int类型中

原文地址: https://www.cveoy.top/t/topic/qe4T 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录