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 difference between structure and union in c programming?
What is the ANSI C Standard?
What are valid signatures for the Main function?
What is the purpose of main( ) in c language?
What are c header files?
What is the difference between functions abs() and fabs()?
In a switch statement, explain what will happen if a break statement is omitted?
List some of the dynamic data structures in C?
Is there any possibility to create customized header file with c programming language?
What is character constants?
Explain about block scope in c?
Write a program to check whether a number is prime or not using c?
What is structure pointer in c?
What is a function in c?
Write the test cases for checking a variable having value in range -10.0 to +10.0?