我自己先写一段代码,这是我在vs中运行过了的
// 1015.1.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<stdio.h>
int main()
{
int x=0x12345678;
char *p=(char *)&x;
if(*p==0x78)
printf("little endian");
else
if(*p==0x12)
printf("big endian");
return 0;
}
我自己先写一段代码,这是我在vs中运行过了的
// 1015.1.cpp : 定义控制台应用程序的入口点。