The usual techniques are to use a pointer:
int x = 1;
if(*(char *)&x == 1)
printf("little-endiann");
else
printf("big-endiann");
or a union:
union {
int i;
...
Some machines store, for example, a two-byte integer with the least significant byte first, followed by the most significant byte. These machines are called little endian machines. Other machines sto...