小端存储和大端存储

 

#include<stdlib.h>
#include<stdio.h>
union UN{
	int i;
	char c[4];
}u = {134480385};
int main(void){
	printf("%p,%d\n%p,%d\n%p,%d\n%p,%d\n",&u.c[0],u.c[0],&u.c[1],u.c[1],&u.c[2],u.c[2],&u.c[3],u.c[3]);
	system("pause");
	return 0;
}

 

小端存储: 

大端存储: 

发布了114 篇原创文章 · 获赞 28 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/ChaoFeiLi/article/details/103587007
今日推荐