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
What is this pointer in c plus plus?
Find MAXIMUM of three distinct integers using a single C statement
What are structural members?
Can math operations be performed on a void pointer?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
Disadvantages of C language.
Explain setjmp()?
How can I open a file so that other programs can update it at the same time?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What are global variables and explain how do you declare them?
What is a 'null pointer assignment' error?
Are pointers integers in c?
Is it fine to write void main () or main () in c?
What is the ANSI C Standard?
What is the use of f in c?