What is the difference between big endian form and little
endian form? write a code to convert big endian form to
little endian and vice versa..
Answer Posted / raj
Little Endian ->LSB at lower address
Big Endian -> MSB at lower address
e.g:
if the value is 0x0A0B0C0D then
in case of LE storage will be
Address 1000 0D
Address 1001 0C
Address 1002 0B
Address 1003 0A
in case of BE storage will be
Address 1000 0A
Address 1001 0B
Address 1002 0C
Address 1003 0D
Marco to convert(this will convert from LE to BE or BE to
LE--> one for all :) )
#define CON(NUM) (NUM&0x000000FF)<<24|(NUM&0x0000FF00)<<8
|NUM&0x00FF0000)>>8 |(NUM&0xFF000000)>>24
| Is This Answer Correct ? | 17 Yes | 3 No |
Post New Answer View All Answers
Differentiate between the expression “++a” and “a++”?
Explain what is a stream?
What is the use of a ‘ ’ character?
Is python a c language?
Write a C program in Fibonacci series.
What is return type in c?
What does calloc stand for?
Explain what is the use of a semicolon (;) at the end of every program statement?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
What does *p++ do?
What is the heap in c?
What is the correct declaration of main?
How can I write a function analogous to scanf?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
Difference between malloc() and calloc() function?