let me clear the things up
structure will take the space collectively by int and char variables both i.e. sizeof(int)+sizeof(char)
union will take the space taken by the largest data type i.e. sizeof(int)
this might be silly but please make it clear -
I thought union will take the size equal to the sum of the size of all characters means there are 8 characters (a,b,c,d,e,f,g,h) and each character will take 1B so total bytes allocated will be 8B , this is not true, right? all charecters will reside in the 1B space.