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 easiest sorting method to use?

1119


What is use of integral promotions in c?

1094


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2312


What are qualifiers?

990


What is a null pointer in c?

1154


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

1024


What is variables in c?

1003


Why do we use int main?

1056


Why shouldn’t I start variable names with underscores?

1026


List out few of the applications that make use of Multilinked Structures?

2136


Do pointers need to be initialized?

1039


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)

2078


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1218


What are void pointers in c?

976


What is the difference between break and continue?

1435