zl程序教程

您现在的位置是:首页 >  其它

当前栏目

为模型推断的端部的大小

模型 大小 推断
2023-09-14 09:10:17 时间

大端模式:高地址的低字节存储,低地址存放高字节。

小端模式:高高字节地址存储,低地址低字节。


#include<stdio.h>



//终端模式估计的大小
int checkMode(){


union Test{
int i;
char ch;

}test;
test.i=1;
return test.ch;


}


int main(void){
int a=checkMode();
if(0==a){
printf("大端模式存储");
}else if(1==a){


printf("小端模式存储");

}


return 0;

}


版权声明:本文博客原创文章。博客,未经同意,不得转载。