How to Declare Union in C ? | Using Union in C | Union Example in C | C Program to Explain use of union

How to Declare Union in C ? | Using Union in C | Union Example in C | C Program to Explain use of union



union tag
{
union_member1;
union_member2;
union_member3;
..
..
..
union_memberN;
}instance;





    Union Members that compose a union , all share the same storage area within the computers memory
    Each member within a structure is assigned its own unique storage area
    Thus unions are used to observe memory.
    Unions are useful for application involving multiple members , where values need not be assigned to all the members at any one time.

No comments:

Post a Comment