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

how to find your architecture is LittleEndian or BigEndian?

Answer Posted / kirankumaryakkala

ans. by using unions we can find it see.
union
{
char ch[2];
int i;
}u;
u.i=512;
printf("%d %d",u.ch[0],u.ch[1]);
printf("%d",u.i);

basically u will see this type of implementation while u r
going through some C books.

depending on the storage seen at ch[0],ch[1] u can find.

u can find the output as ch[0]=0,ch[1]=2 \\little endian
(or) ch[0]=2,ch[2]=0\\bigendian
like this u can find the endian....

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the total generic pointer type?

1213


Is there a built-in function in C that can be used for sorting data?

1343


any "C" function by default returns an a) int value b) float value c) char value d) a & b

1138


What is sizeof c?

1125


Does free set pointer to null?

1067


Explain what is the difference between functions getch() and getche()?

1113


What is the meaning of ?

1085


Why is c faster?

1187


What is the difference between #include and #include 'file' ?

1122


Explain how can you be sure that a program follows the ansi c standard?

1548


How is a structure member accessed?

1196


Explain what is operator promotion?

1153


What is difference between static and global variable in c?

1106


What is array of structure in c?

1254


What is the use of getchar functions?

1234