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
What is const and volatile in c?
Can main () be called recursively?
What is c programing language?
What is cohesion and coupling in c?
What is pointers in c with example?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
Explain the difference between malloc() and calloc() in c?
Can you add pointers together? Why would you?
What is the role of && operator in a program code?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
I heard that you have to include stdio.h before calling printf. Why?
Difference between macros and inline functions? Can a function be forced as inline?
What is mean by data types in c?
What is chain pointer in c?