#define LITTLE 0
#define BIG 1
int
endian_check(void) {
union {
short a;
char b[2];
} endian;
endian.a = 0x0102;
if(endian.b[0] == 0x02)
return LITTLE;
else
return BIG;
}
#define BIG 1
int
endian_check(void) {
union {
short a;
char b[2];
} endian;
endian.a = 0x0102;
if(endian.b[0] == 0x02)
return LITTLE;
else
return BIG;
}

comments
comments rss (+댓글 쓰러가기)