how to find your architecture is LittleEndian or BigEndian?
Answer Posted / 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 |
Post New Answer View All Answers
What is the maximum length of an identifier?
What is the use of f in c?
What is a nested loop?
What is meant by int main ()?
What is a structure member in c?
Explain the difference between malloc() and calloc() in c?
Here is a good puzzle: how do you write a program which produces its own source code as output?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
What are high level languages like C and FORTRAN also known as?
How do you generate random numbers in C?
Which one would you prefer - a macro or a function?
What is meant by preprocessor in c?
What is the difference between volatile and const volatile?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..