#include int main(){ int n = 1; // little endian if true if(*(char *)&n == 1){ printf("little endian\n"); }else{ printf("big endian\n"); } }