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
Can we replace the struct function in tree syntax with a union?
Ow can I insert or delete a line (or record) in the middle of a file?
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
Where in memory are my variables stored?
difference between Low, Middle, High Level languages in c ?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
What is storage class?
How can I change the size of the dynamically allocated array?
What is NULL pointer?
What is the use of a conditional inclusion statement in C?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
What is a global variable in c?
When should we use pointers in a c program?
Describe the difference between = and == symbols in c programming?
What is sizeof int?