word_presentation
x is integer, x = 0x01234567
Big endian
address | 0x100 | 0x101 | 0x102 | 0x103 | 0x104 |
… | 01 | 23 | 45 | 67 | … |
Little endian
address | 0x100 | 0x101 | 0x102 | 0x103 | 0x104 |
… | 67 | 45 | 23 | 01 | … |
The example to show what type is on your computer.
#include<stdio.h>
int main()
{
int a = 0x01234567;
char *p = &a;
int i=0;
for(i=0;i<4;i++)
printf("%.2x",*p++);
return 0;
}
page revision: 2, last edited: 30 Sep 2008 13:55