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 was noalias and what ever happened to it?
write a “Hello World” program in “c” without using a semicolon?
Write a program to display the no of bit difference between any 2 given numbers eg: Num1 will 12->1100 Num2 will 7->0111 the difference in bits are 2.
What is the difference between break and continue?
What is the function of ceil(X) defined in math.h do? A)It returns the value rounded down to the next lower integer B)it returns the value rounded up to the next higher integer C)the Next Higher Value D)the next lower value
What is the scope of local variable in c?
difference between string and array?
What is the difference function call by value & function call by reference?
a C prog to swap 2 no.s without using variables just an array?
What is data structure in c programming?
what do you mean by inline function in C?
what is event driven software and what is procedural driven software?