check the endianness in c code example Example: c detect endianness #define IS_LITTLE_ENDIAN (*(unsigned char *)&(uint32_t){1})