endian
来源:互联网 发布:ug中心钻编程 编辑:程序博客网 时间:2024/05/19 13:25
1、what is the address of a multiple data?
the smallest
0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8
-----------------------------------------------
-----------------------------------------------
#include <stdio.h>
int main()
{
int a[2];
if (&a[0] < &a[1]) printf("that's right !\n");
struct test{
unsigned ui;
unsigned char x[4];
}o_o;
if ((unsigned)&o_o.ui < (unsigned)&o_o.x[0]) printf("that's right!\n");
return 0;
}
2、what is the endian?
#include <stdio.h>
char endian(void)
{
int i = ~0 - 1;
return *(unsigned char *)&i==0xfe ? 'L' : 'B';
}
char int_endian(void){
int i = ~0 - 1;
return *(char *)&i == -2 ? 'L' : 'B';
}
int main()
{
endian()=='L' ? printf("little endian\n") : printf("big endian\n");
int_endian()=='L' ? printf("little endian\n" ) : printf("big endian\n");
return 0;
}
3、what is used the int constant ?
oct: 0xxxxxxxxxxx+UL
hex: 0xffffffffffffffffff+ UL
dec: ---> +/-
#include <stdio.h>
int main()
{
int i = 0x12345678U;
printf("%x\n", i);
return 0;
}
- Endian
- endian
- Endian
- Endian
- Little endian & Big endian
- big-Endian&little-Endian
- big-Endian&little-Endian
- big-Endian&little-Endian
- little endian && big-endian
- Big endian & Little endian
- Litter endian/Big endian
- big-endian/little-endian
- Big endian Little endian
- Big-endian & Little-endian
- Little-endian & Big-endian
- big endian & little endian
- Big endian Little endian
- Little Endian, Big Endian
- SIFT算法学习
- NSThread应用
- 矩阵的特征值 => 矩阵的幂 => 广义斐波拉契数列的通项公式
- SGU 130 Circle
- struts2 报错:freemarker.log.JDK14LoggerFactory$JDK14Logger error
- endian
- Magento安装后无法访问,提示“Illegal scheme supplied, only alphanumeric characters are permitted”
- Access restriction: The type BASE64Encoder is not accessible due to restrict on required library
- 2012C++程序设计实验报告【6.5】
- Linux下递归打印一个文件夹下的所有文件夹和文件
- javascript的prototype继承
- struts2 validation error只出现在控制台中,但是input的页面中却没有显示
- IOS开发系列——xml文件解析
- pthread线程优先级的调度