int checkSystem2(void)
{
APP_INT32U i = 0x12345678;
APP_INT32U *c = &i;
return ((c[0] == 0x78) && (c[1] == 0x56) && (c[2] == 0x34) && (c[3] == 0x12));
}
if(checkSystem2())
printf("little endiann");
else
printf("big endiann");
测试后发现STM8L为大端
『本文转载自网络,版权归原作者所有,如有侵权请联系删除』