Hello I try to dectect byte order "Endianess" using arrays.
If we define an array of 2 elements, in little endian element 0 shall be stored first simple comarsion of address of element 0 and 1 should give the answer. However element 1 will always have higher addresss.
Does it make any sense?Code:char array[] = {'A','B'}; if (&(array[1]) > &(array[0])) { printf("Little Endian \n"); }