程序代码:
#include<stdio.h> #include<stdlib.h> int check_sys() { int n = 1; return *((char*)&n); } int main() { int ret = check_sys(); if (ret = 1) { printf("little\n"); } else { printf("big\n"); } system("pause"); return 0; }
运行结果:
little
请按任意键继续. . .
Yarchitect ©著作权
程序代码:
#include<stdio.h> #include<stdlib.h> int check_sys() { int n = 1; return *((char*)&n); } int main() { int ret = check_sys(); if (ret = 1) { printf("little\n"); } else { printf("big\n"); } system("pause"); return 0; }
运行结果:
little
请按任意键继续. . .
上一篇:指针数组与数组指针的区别
下一篇:结构体在内存中的存储方式
编写函数判断当前的机器大端小端(1)使用指针判断(2)使用union判断
大端小端的判断
介绍大端小端模式各自的特点,以及辨别的两种方法
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M