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

Write a small C program to determine whether a machine's
type is little-endian or big-endian.

Answer Posted / anuraag

Vasudhara's solution is correct!
Still here is an alternative solution to check endianess
without using pointers...

int main()
{
int x=0x58;
char ch;
ch=x;

if(ch=0x58)
printf("Little Endian");
else
printf("Big Endian");
return 0;
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

2076


In C language what is a 'dangling pointer'?

1118


What does return 1 means in c?

1057


Explain how can I avoid the abort, retry, fail messages?

1034


What is main return c?

980


Explain the binary height balanced tree?

1171


What is the function of multilevel pointer in c?

1067


What is scope rule of function in c?

1074


can we implement multi-threads in c.

1119


How can I make it pause before closing the program output window?

1030


What is scanf_s in c?

1102


What are the types of data types and explain?

1078


How do we open a binary file in Read/Write mode in C?

1231


What is atoi and atof in c?

1075


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

1212