S
siddharth.munshi
union something
{
float a;
int b;
} u;
int main()
{
printf("%d %d\n",&u.a,&u.b);
u.a = 200;
printf("%f %d \n",u.a,u.b);
return 0;
}
The above code prints:
134518260 134518260
200.00000 1128792064
While the first line of output explains itself. I want to know what is
the relation between the value that we set for 'a', and the value that
'b' returns.
{
float a;
int b;
} u;
int main()
{
printf("%d %d\n",&u.a,&u.b);
u.a = 200;
printf("%f %d \n",u.a,u.b);
return 0;
}
The above code prints:
134518260 134518260
200.00000 1128792064
While the first line of output explains itself. I want to know what is
the relation between the value that we set for 'a', and the value that
'b' returns.