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
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.
In C language what is a 'dangling pointer'?
What does return 1 means in c?
Explain how can I avoid the abort, retry, fail messages?
What is main return c?
Explain the binary height balanced tree?
What is the function of multilevel pointer in c?
What is scope rule of function in c?
can we implement multi-threads in c.
How can I make it pause before closing the program output window?
What is scanf_s in c?
What are the types of data types and explain?
How do we open a binary file in Read/Write mode in C?
What is atoi and atof in c?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?