What is union difference between union & structure explain with suitable example?

Structure and union both are user-defined data types in the C/C++ programming language. In this section, we will see what the Structure and Union are; and the differences between them. … Difference between Structure and Union. StructUnionEach variable member will be assessed at a time.Only one variable member will be assessed at a time.Difference between Structure and Union – javatpoint www.javatpoint.com › structure-vs-union

Read more

What is the advantage of union in C?

Advantages of union When you use union, only the last variable can be directly accessed . Union is used when you have to use the same memory location for two or more data members. It enables you to hold data of only one data member. Its allocated space is equal to maximum size of the data member.

Read more