Big endian or Little endian

How will you find whether your system is following Big endian or Little endian representations. Write C code. In Little endian, the lowest byte is stored in lowest address.

Showing Answers 1 - 1 of 1 Answers


  • Jan 31st, 2016

The best way to check whether CPU follows little endian or big endian :
int var=1;
printf("Little endian
printf("Big endian
size of all pointers are same but the main difference comes when you fetch the data back using specified data types.Here char*p holding the address of integer if cpu follows little endian then 1 will be present in lower address as char * will fetch only 1 byte.Simple...!!!

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions