Hi Everyone!
I have written a code for it,it gives 2 warning messages but still gives the right answer.Can you share better ideas to implement for this concept.
Tryin to store address in int var is the warning,but when I try to use pointers and implement,the difference between the addresses i given as 1 and not 8.Code:#include<stdio.h> union size { int i; double d; }u[1]; int main() { int res,a,b; a=u+0; b=u+1; res=b-a; printf("size of union=%d\n",res); return 0; }