Definition:-
Union is similar to structure, except it allows you to define the variable that share storage spaces.Defining a means creating a new data types.
How use union:-
when we create a structure by using struct keyword, now making a union we just replace the keyword struct with the keyword union , other syntax will be same.
Difference between Structure and Union:- the only difference between them is in memory.
NOTE:- union is used for low level programming but structure mostly used for high level programming.
Program to access union:-
"""SHARE IT WITH YOUR FRIENDS IF HE DID NOT KNOW""""
Union is similar to structure, except it allows you to define the variable that share storage spaces.Defining a means creating a new data types.
How use union:-
when we create a structure by using struct keyword, now making a union we just replace the keyword struct with the keyword union , other syntax will be same.
Difference between Structure and Union:- the only difference between them is in memory.
NOTE:- union is used for low level programming but structure mostly used for high level programming.
Program to access union:-
"""SHARE IT WITH YOUR FRIENDS IF HE DID NOT KNOW""""
Comments
Post a Comment