- UNIT-I (Array)
strlen(),strcpy(), strcat() ,strcmp()
Definition
Macro substitution directives
File inclusion directives
Conditional compilation
Bitwise Operators
Shift operators
Masks
Bitfield
Macro substitution directives
File inclusion directives
Conditional compilation
Bitwise Operators
Shift operators
Masks
Bitfield
Differentiate between Union and structure
Structure Union
Struct keyword is used to define a structure. Union keyword is used to define a union.
Members do not share memory in a structure. Members share the memory space in a union.
Any member can be retrieved at any time in a structure. Only one member can be accessed at a time in a union.
Several members of a structure can be initialized at once. Only the first member can be initialized.
The size of the structure is equal to the sum of the size of each member. The size of the union is equal to the size of the largest member.
Altering the value of one member will not affect the value of another. Change in the value of one member will affect other member values.
Stores different values for all the members. Stores the same value for all the members.
Structure | Union |
Struct keyword is used to define a structure. | Union keyword is used to define a union. |
Members do not share memory in a structure. | Members share the memory space in a union. |
Any member can be retrieved at any time in a structure. | Only one member can be accessed at a time in a union. |
Several members of a structure can be initialized at once. | Only the first member can be initialized. |
The size of the structure is equal to the sum of the size of each member. | The size of the union is equal to the size of the largest member. |
Altering the value of one member will not affect the value of another. | Change in the value of one member will affect other member values. |
Stores different values for all the members. | Stores the same value for all the members. |
कोई टिप्पणी नहीं:
एक टिप्पणी भेजें