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..

Answers were Sorted based on User's Feedback



What is the difference between big endian form and little endian form? write a code to convert big..

Answer / peter

Little endian has least significant digit at far left.
Big endian has most significant digit at far left.

Is This Answer Correct ?    28 Yes 8 No

What is the difference between big endian form and little endian form? write a code to convert big..

Answer / 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

What is the difference between big endian form and little endian form? write a code to convert big..

Answer / amit

the endianness of a bus determines whether the MSB is put
into the lowest address
(big-endian) or in the highest address (little-endian).

Is This Answer Correct ?    13 Yes 5 No

What is the difference between big endian form and little endian form? write a code to convert big..

Answer / vivek

in little endien lsb is at lower addess and in big endien
msb at lower address

Is This Answer Correct ?    1 Yes 0 No

What is the difference between big endian form and little endian form? write a code to convert big..

Answer / vish

Small correction in above macro.
'(' was missing in second line.

#define CON(NUM) (NUM&0x000000FF)<<24|(NUM&0x0000FF00)<<8
|(NUM&0x00FF0000)>>8 |(NUM&0xFF000000)>>24

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More C Interview Questions

write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.

0 Answers  


What is string concatenation in c?

0 Answers  


Find the O/p of the following struct node { char *name; int num; }; int main() { struct node s1={"Harry",1331}; struct node s2=s1; if(s1==s2) printf("Same"); else printf("Diff"); }

1 Answers  


What are structures and unions? State differencves between them.

0 Answers   iNautix,


can we declare a function in side the structure?

2 Answers   HCL,






how we can say java is platform independent, while we require JVM for that particular Operating System?

3 Answers   Honeywell, TCS,


What is the difference between i++ and i+1 ?(in terms of memory)

3 Answers   HCL,


Explain heap and queue.

0 Answers   Aricent,


Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?

0 Answers  


What are pointers? What are stacks and queues?

0 Answers   Hexaware,


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

0 Answers   Wipro,


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

0 Answers   Aegis, CDAC, Infosys,


Categories