Listen "Unions in C language."
Episode Synopsis
Unions in C language.
A union is a special data type available in C that allows to store different data types in the same memory location. We can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory location for multiple-purpose.
To define a union, we must use the union statement in the same way as we did while defining a structure. The union statement defines a new data type with more than one member for our program.
The memory occupied by a union will be large enough to hold the largest member of the union.
To access any member of a union, we use the member access operator (.). The member access operator is coded as a period between the union variable name and the union member that we wish to access. We would use the keyword union to define variables of union type.
A union is a special data type available in C that allows to store different data types in the same memory location. We can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory location for multiple-purpose.
To define a union, we must use the union statement in the same way as we did while defining a structure. The union statement defines a new data type with more than one member for our program.
The memory occupied by a union will be large enough to hold the largest member of the union.
To access any member of a union, we use the member access operator (.). The member access operator is coded as a period between the union variable name and the union member that we wish to access. We would use the keyword union to define variables of union type.
More episodes of the podcast Learn from voice....
Storage class in C language.
17/01/2021
Enumeration in C language.
17/01/2021
Structures in C language.
16/01/2021
Functions in C language.
16/01/2021
ZARZA We are Zarza, the prestigious firm behind major projects in information technology.