how to find your architecture is LittleEndian or BigEndian?
Answer / kirankumaryakkala
ans. by using unions we can find it see.
union
{
char ch[2];
int i;
}u;
u.i=512;
printf("%d %d",u.ch[0],u.ch[1]);
printf("%d",u.i);
basically u will see this type of implementation while u r
going through some C books.
depending on the storage seen at ch[0],ch[1] u can find.
u can find the output as ch[0]=0,ch[1]=2 \\little endian
(or) ch[0]=2,ch[2]=0\\bigendian
like this u can find the endian....
| Is This Answer Correct ? | 3 Yes | 1 No |
What is the use of linkage in c language?
what is the difference between entry control and exit control statement?
12 Answers Darbari Lal DAV Model School,
Write a program to print fibonacci series without using recursion?
Can a void pointer point to a function?
how to construct a simulator keeping the logical boolean gates in c
How can a program be made to print the name of a source file where an error occurs?
What is string function c?
main difference between c and c++ language
What is the output of following program ? int main() { int x = 5; printf("%d %d %d\n", x, x << 2, x >> 2); }
What are the types of pointers in c?
write a program to count the no of repaeted words in a line?
Why void is used in c?