c detect endianness
snippet in c

c detect endianness

user377

#define IS_LITTLE_ENDIAN (*(unsigned char *)&(uint32_t){1})