Write a simple program to test whether the "int "data type are stored as
big-endian or little-endian on a specific machine.
(Constraint :"pointer"type should not be used in the program if you use c/c++)
(Suppose a numeric data of type "int" data type use 4 bytes)好像很简单,可是我想了半天都觉得被什么卡住了,考官也说这道题很难,希望能被做出来的人给打动!
big-endian or little-endian on a specific machine.
(Constraint :"pointer"type should not be used in the program if you use c/c++)
(Suppose a numeric data of type "int" data type use 4 bytes)好像很简单,可是我想了半天都觉得被什么卡住了,考官也说这道题很难,希望能被做出来的人给打动!
解决方案 »
- vc++2010类向导问题
- 关于MFC RecordSet Update函数运行失败问题,详情如下
- 求高手帮助把下面的c程序改成一个MFC的程序
- ADO控件和chart图表控件的绑定问题
- 帮忙看看这段结束QQ进程的代码 为什么不好使
- c++的东西在vc中不好使吗?
- 用com访问oracle(1521端口)时会被kill关掉怎么办?(很急!)
- 又一个基础的问题
- 简单问题!!关于图标
- typedef struct 和 struct 的分別?
- AfxGetApp()->WriteProfileString("LINE\\DVR","Password","hhh");写进注册表啦!!!还是写Win.ini,为啥看我在这两项都看不到呀?
- 单文档问题
是什么意思?
int main()
{ union
{
int a;
short b[2];
}kg;
kg.a=0x00010002;
if (kg.b[0]==1&&kg.b[1]==2)
printf("big");
else if(kg.b[0]==2&&kg.b[1]==1)
printf("little");
else
printf("god knows!@#!@#");
return 0;
}
big-endian or little-endian on a specific machine.
(Constraint :"pointer"type should not be used in the program if you use c/c++)
(Suppose a numeric data of type "int" data type use 4 bytes)写一个简单的程序,测试一下在指定的机器上 “int”数据类型是用 big-endian 还是 little-endian 存储的条件:如果用 c/c++ 不能使用"pointer"
假设:一个 int 类型为 4 个字节
我的英语不好,不知我看得对不对,本题是什么意思?
这个 big-endian 是什么意思? 大结尾?
关注,