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 are the advantages of the functions?
Explain #pragma in C.
What are the 4 types of organizational structures?
What is #define?
what is computer
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
void main() { int i=5; printf("%d",i+++++i); }
write a program to swap two numbers without using temporary variable?
tell me the full form of c?
What does %c mean in c?
How do you write a program which produces its own source code as output?
why return type of main is not necessary in linux