415 views
–1 votes
–1 votes
#include <stdio.h>
int main()
{
    unsigned char arr[2] = {0x01, 0x00};
    unsigned short int x = *(unsigned short int *) arr;
    printf("%d", x);
    getchar();
    return 0;
}

Output in little endian and big endian ?

Please someone provide a detailed explanation if possible with diagram.

Please log in or register to answer this question.

Related questions

0 votes
0 votes
2 answers
2
Narayan Kunal asked Sep 4, 2014
763 views
I saw on http://www.cquestions.com/2009/06/memory-representation-of-int-data-type.html but it seems wrong to me. Please clarify.
1 votes
1 votes
1 answer
3
Pawan Kumar 2 asked Nov 23, 2017
308 views
how this hex representation is done?
1 votes
1 votes
1 answer
4