源程序如下:
i = 0x12345678;
printf("\r\ni = 0x%X,",i);
printf("addri = 0x%X,",&i);
printf("\r\naddru8i = 0x%X,",(u8*)(&i));
printf("u8i = 0x%X,",*((u8*)(&i)));
printf("\r\naddru8i+1 = 0x%X,",(u8*)(&i)+1);
printf("u8i+1 = 0x%X,",*((u8*)(&i)+1));
printf("\r\naddru8i+2 = 0x%X,",(u8*)(&i)+2);
printf("u8i+2 = 0x%X,",*((u8*)(&i)+2));
printf("\r\naddru8i+3 = 0x%X,",(u8*)(&i)+3);
printf("u8i+3 = 0x%X,",*((u8*)(&i)+3));
printf("\r\nTP_test:end");
串口打印出的数据如下:
i = 0x12345678,addri = 0x2001A08C,
addru8i = 0x2001A08C,u8i = 0x78,
addru8i+1 = 0x2001A08D,u8i+1 = 0x56,