Difference between Structure and Union in C Program | Gujarati Ma

 


Instagram https://www.instagram.com/bca.school Facebook https://www.facebook.com/bcaschooll Website https://bcaschool.blogspot.com/


In C, we have containers to hold data of same data type as well as different data types. C provides the concept of Arrays to store data variables of same type; while for storing data of different types, C has the concept of structures and unions.

Both Structures and Unions can hold different types of data, but on the basis of their internal implementation, we can find several differences in both of these containers. Read this article to learn more about structures and unions and how they are different from each other.

What is Structure in C Program?

In C programming, a Structure is a userdefined datatype. It is basically used to combine different datatypes into a single datatype. A structure in a C program can contain multiple members and structure variables. In order to define structures, the 'struct' keyword is used. To access the members of a structure, we use the dot (.) operator.



Post a Comment

Thanks for comment.

Previous Post Next Post