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
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Explain how can I convert a number to a string?
What functions are used in dynamic memory allocation in c?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
What is a method in c?
Is c procedural or functional?
What does sizeof return c?
Where does the name "C" come from, anyway?
How is a null pointer different from a dangling pointer?
What is use of #include in c?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What is wrong with this program statement?
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
how many errors in c explain deply
Suggesting that there can be 62 seconds in a minute?