Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Is there any possibility to create customized header file with c programming language?

1009


What is typedef?

1339


What is variable in c example?

994


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1051


What is masking?

1105


Why can't I perform arithmetic on a void* pointer?

1048


Do you know the difference between malloc() and calloc() function?

1009


provide an example of the Group by clause, when would you use this clause

2129


Why is c fast?

1012


What are the c keywords?

1148


Explain what is the benefit of using an enum rather than a #define constant?

1172


What is void main () in c?

1154


What standard functions are available to manipulate strings?

1078


What is boolean in c?

1036


Why is c known as a mother language?

1189