blob: 0583803c94bb9ed242c3eb5bf7713f88bb01e914 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#include <stdio.h>
int
main ()
{
unsigned int a = 0x1234;
if ( (unsigned int) ( ((unsigned char *)&a)[0]) == 0x34 ) {
printf("little-endian\n");
return 0;
} else {
printf("big-endian\n");
return 1;
}
}
|