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
When we use void main and int main?
For what purpose null pointer used?
Can a variable be both constant and volatile?
What do you understand by friend-functions? How are they used?
Why functions are used in c?
What's the best way of making my program efficient?
Why void is used in c?
number of times a digit is present in a number
all c language question
What are linker error?
What does the && operator do in a program code?
What does emoji p mean?
What are examples of structures?
What is sizeof int?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.