In Big endian, the Most significant byte within the word is stored first(at lower address).
In Little endian, the Least significant byte within the word is stored first(at lower address).
So, if word size is 1 Byte, then little-endian and Big-endian have no difference. Data will be stored in the same way in both of them.
If word size is 2Bytes and this is how 10,11,12,13 are stored in big endian:-
WORD1 |
WORD2 |
00001010(1st byte within word1) 00001011(2nd byte within word1) |
00001100(1st byte within word2) 00001101(2nd byte within word2) |
Then this is how it will be stored in little endian:-
WORD1 |
WORD2 |
00001011(1st byte within word1) 00001010(2nd byte within word1) |
00001101(1st byte within word2) 00001100(2nd byte within word2) |
In question, there are two words in the array. Each word has two Bytes. In little and big endian , these bytes within the word will be reverse of each other.
first byte of word1 is 12 and second byte of word1 is 34. So in little endian, first byte of word1 will have 34 and second byte of word1 will have 12.
first byte of word2 is 56 and second byte of word2 is 78. So in little endian, first byte of word1 will have 78 and second byte will have 56.
So, answer is option (C)