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 total generic pointer type?
#include
Do pointers store the address of value or the actual value of a variable?
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
why do some people write if(0 == x) instead of if(x == 0)?
Do you know pointer in c?
Explain the meaning of keyword 'extern' in a function declaration.
How to declare a variable?
What is volatile variable in c with example?
What is an array in c?
Is c++ based on c?
What is a pointer on a pointer in c programming language?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is a nested formula?
Is it better to use malloc() or calloc()?