Union u{ struct st { int i : 4; int j : 4; int k : 4; int l; }st; int i;}u;main(){ u.i = 100; printf("%d, %d, %d",u.i, u.st.i, u.st.l);}

100,4,0

Questions by amitbaranwal

Showing Answers 1 - 2 of 2 Answers

shiva

  • Sep 27th, 2011
 

u.i=100 // initialized in main i.e 100
u.s.j=4 // initialized in struct i.e 4
u.s.l=0 // not initialized so default os struct i.e 0

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions