Pergunta de entrevista da empresa Intel Corporation

It was a telephonic interview and he asked me to write a small code and read it. The programming question was how will you identify whether a system is little endian or big endian? write a code for that.

Resposta da entrevista

Sigiloso

16 de mar. de 2015

#include int main() { unsigned int i = 1; char *c = (char*)&i; if (*c) printf("Little endian"); else printf("Big endian"); getchar(); return 0; }