为模型推断的端部的大小

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

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


#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;

}


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

原文地址:https://www.cnblogs.com/blfshiye/p/4750319.html