1 #define BIG_ENDIAN 0
2 #define LITTLE_ENDIAN 1
3 int TestByteOrder() {
4 short int word = 0x0001;
5 char *byte = (char *) &word;
6 return (byte[0] ? LITTLE_ENDIAN : BIG_ENDIAN);
7 }
2 #define LITTLE_ENDIAN 1
3 int TestByteOrder() {
4 short int word = 0x0001;
5 char *byte = (char *) &word;
6 return (byte[0] ? LITTLE_ENDIAN : BIG_ENDIAN);
7 }
No comments:
Post a Comment