main()
{
union u
{
struct s{int a;int b}n;
struct ss{int c;long d}ni;
}uu;
uu.ni.c=1;
uu.ni.d=0;
printf("%d %d",(uu.n.a),(uu.n.b));
}
output:
1
32767
Now my question is that even though I put d=0 then why does it shows 32767 as output for b?As per my knowledge union members share the same place of memory..Then why is this hapenning here?