Search This Blog

Translate

Explain Union in c differece between unionand arry

Explain Union in c
union is used to group a number of different variables together.
In structure number of different variables of different data type stored in different memory places but in union different variable of different data type are store in same place.
Example:

struct student
{
introllno;
char name[50];
float salary;
};

union student
{
introllno;
char name[50];
float salary;
};

C Program example List

Google+ Badge