c++——大端序,小端序的排列问题

 

#include<iostream>
using namespace std;

union TestModel
{
	int i;
	char ch;
};

int main()
{
	union TestModel model;
	model.i = 1;
	if(model.i==1)
	{
		cout<<"little"<<endl;
	}
	else
	{
		cout<<"big"<<endl;
	}

    cout<<"sizeof(void *): "<<sizeof(void *)<<endl;
	system("pause");
	return 0;
} 

 

posted on 2019-03-28 14:55  陶大先生  阅读(191)  评论(0编辑  收藏  举报

导航