I'm looking forward for a way whereby I can find the endianness without implicit/explicit casting, loops, switch, inbuilt functions, macros. I have tried a code but it uses explicit casting.
int is_little_endian(){
int temp = 1;
return *(char *) temp;//Returns 1 if it's a little endian machine.
}
[edit]
It has to be done without use of any casting. I couldn't find a question whereby we can do it without casting and use of macros. Implicit Casting herein in refers to automatic casting by compiler. Say from char to int.