📄 host-order.c
字号:
/*Little Application to test processor's endian mode*/#include <stdio.h>int main(){ unsigned int a[1]; a[0] = 0x3344; unsigned char *b = a; unsigned char *c = (b+0x00000001); printf("a:0x%x,b:0x%x,c:0x%x,a[0]:0x%x,*b:0x%0x,*c:0x%x\n",a,b,c,a[0],*b,*c); if(*b == 0x33) printf("the host(processor) byte order is big-endian!\n"); if(*b == 0x44) printf("the host(processor) byte order is little-endian!\n"); printf("unsigned int:%d\n",sizeof(unsigned int)); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -