Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2616496
  • 博文数量: 877
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 5921
  • 用 户 组: 普通用户
  • 注册时间: 2013-12-05 12:25
个人简介

技术的乐趣在于分享,欢迎多多交流,多多沟通。

文章分类

全部博文(877)

文章存档

2021年(2)

2016年(20)

2015年(471)

2014年(358)

2013年(26)

分类: C/C++

2014-07-06 02:22:07

http://yijiuzai.blog.163.com/blog/static/1037567272013031399284/
#include
using namespace std;
int checkCPU(char x)
{
    if(x==0x12)
    {
        return (0);
 
    }
    else
        return (1);
     
}
 
union
{
    short s;
    char c[2];
}x;
 
int main()
{
x.s=0x1234;
if(checkCPU(x.c[0])==0)
cout<<"Big_endian"<
else
cout<<"Little_endian"<
return(0);
}

阅读(318) | 评论(0) | 转发(0) |
0

上一篇:CCID枚举

下一篇:EXPORT、IMPORT、EXTERN含义

给主人留下些什么吧!~~