Endianness.

Processors little endian or big endian

See version :

Pas de dépendances

Download :

#include <stdio.h>

int endian_test()
{
    char t[2]={0,1};
    short* s = (short*)(&(t[0]));
    if (*s==256)
        return 1;
    else
        return 0;
}

int main()
{
    if (endian_test()==1)
        printf("Vous utilisez un processeur Little Endian (Intel ?)\n");
    else
        printf("Vous utilisez un processeur Big Endian (Motorola ?)\n");
    return 0;
}



Explanations

	No explanations yet.