1 #include<stdio.h>
 2 int main()
 3 {
 4     int x = 1;
 5     if(*(char*)&x == 1){
 6         printf("normal order\n");
 7     }
 8     else{
 9         printf("not normal order, maybe powerpc\n");
10     }
11 
12 
13 }

参考资料:Linux Kernel Development(Third Edition)书后末尾章节
以上在Ubuntu的笔记本电脑上测试通过,显示为正常字节序。

 

相关文章:

  • 2022-02-11
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2021-12-09
  • 2021-09-26
猜你喜欢
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2021-09-28
  • 2021-12-22
相关资源
相似解决方案