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;
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License