Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?

a) ABCD
b) DCBA
c) 0 * ABCD
d) Depends on big endian or little endian architecture

Answer: d
Explanation: “Little Endian” means that the lower-order byte of the number is stored in memory at the lowest address, and the high order byte at the highest address. For example, a 4 byte Integer ABCD will be arranged in memory as follows:
Base Address + 0 Byte 0.
Base Address + 1 Byte 1.
Base Address + 2 Byte 2.
Base Address + 3 Byte 3.
Intel processors (those used in PC’s) use “Little Endian” byte order. “Big Endian” means that the high-order byte of the number is stored in memory at the lowest address, and the low-order byte at the highest address. The same 4 byte integer would be stored as:
Base Address + 0 Byte 3.
Base Address + 1 Byte 2.
Base Address + 2 Byte 1.
Base Address + 3 Byte 0.

Join The Discussion