Write a program to determine the endian-ness of a computer. Determine the endian-ness of at least three different kinds of processors on campus. Can you discern any difference in bit ordering within the bytes? (Hint: Use a pointer to peek at how the bytes are arranged in a multi-byte data type.) We found that there was different ordering of the bits withing bytes depending on if the machine was little endian or big endian. We used a union to check this and could tell the byte ordering from this. We found that P4s are little endian, AMDs are little endian, Sparcs are big endian, and G4s are big endian. |