Feed Headline Animator

What are unions in C language, explain

Unions: -

A union is a memory location just like a structure which has number of variables of different data type. The syntax of a union in C language is just like the structure syntax, such that:
Union name of union
{
Type member variables;
}
Union name of union using new name;
In this topic we also use a dot (.) operator with its new reference name.
For example
Union mem
{
Int a;
Char b;
};
Union name value;
So we can use its reference name value with its member variables as:
Value . a;
Value . b;


Posted by: Wasim Javed

No comments:

Post a Comment