karan1311 posted: "Structure
A Structure always allocates memory in the form of block, and block size depends on the longest data member of the structure.
If a structure contains a slack byte, it's called an Imbalanced Structure.
Word alignment is required to "
Respond to this post by replying above this line |
New post on Encapsulate {Ideas}
|
|
Structure
- A Structure always allocates memory in the form of block, and block size depends on the longest data member of the structure.
- If a structure contains a slack byte, it's called an Imbalanced Structure.
- Word alignment is required to covert imbalanced structure into balanced structure.
- A structure cannot be nested within the same structure, unless the nested structure is a pointer, i.e., self-referential structure.
- Structures are used for data encapsulation, memory links and bit-fields.
- Two structure variables cannot be compared.
- One structure variable can be assigned to another structure variable, if both belong to the same structure.
- Bit Field is a unique feature in C which can be applied to a structure for memory optimization.
- Each data member of a structure begins at different places.
- Bit Field range must be between 1 and the size of its data member.
- Bit Field is not allowed for float data members.
- Union provides a way to share common memory in different ways.
|
|
|
|
|