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 easiest sorting method to use?
What is use of integral promotions in c?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
What are qualifiers?
What is a null pointer in c?
Do you know the difference between malloc() and calloc() function?
What is variables in c?
Why do we use int main?
Why shouldn’t I start variable names with underscores?
List out few of the applications that make use of Multilinked Structures?
Do pointers need to be initialized?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
What are void pointers in c?
What is the difference between break and continue?