Answers

2014-05-09T08:01:13+05:30
A union is a way of providing an alternate way of describing the same memory"static", or similar portion of the data is described first, and the portion
0
2014-05-09T08:59:45+05:30
All the members of the structure can be accessed at
once,where as in an union only one member can be used at a time.
Another important difference is in the size allocated to a
structure and an union.
for eg:
struct example
{
int integer;
float floating_numbers;
}
the size allocated here is sizeof(int)+sizeof(float);
where as in an union
union example
{
int integer;
float floating_numbers;
}
size allocated is the size of the highest member.
so size is=sizeof(float);
 

0