Pregunta de entrevista de Evertz Microsystems

Write a function which indicates the endianness of a 4 byte word.

Respuesta de la entrevista

Anónimo

12 sep 2016

int main() { int x=0x00000001; char *ptr = (char*)&x; if(*ptr == 1) { printf("\n Little Endian"); } else { printf("\n Big Endian"); } return 0; }