int main(void) { //if (endian() == LITTLE_ENDIAN) { if (endian2() == LITTLE_ENDIAN) { printf("Little endian\n"); } else { printf("Big endian\n"); } return 0; }
int main() { int test = 1; char * endian = (char*)&test; printf("result is %d\n", *endian); printf("result2 is %d\n", endian2()); return 0; }