Write a small C program to determine whether a machine's
type is little-endian or big-endian.
Answer Posted / vasundhara
int main()
{
int x=1;
if(*(char*)&x)
printf("little endian");
else
printf("big endian");
return 0;
}
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
What is void c?
Differentiate between #include<...> and #include '...'
Can you mix old-style and new-style function syntax?
What is %s and %d in c?
What is pass by value in c?
What are the different types of linkage exist in c?
What is the difference between array_name and &array_name?
How can I determine whether a machines byte order is big-endian or little-endian?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
Explain the difference between call by value and call by reference in c language?
Which is better oop or procedural?
Explain #pragma statements.
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Subtract Two Number Without Using Subtraction Operator