Difficulty: Easy
Correct Answer: Correct
Explanation:
Introduction / Context:
Nested (or composite) aggregates are common in data modeling. This item checks whether C permits struct-within-struct design, which is frequently used for grouping related fields hierarchically.
Given Data / Assumptions:
Concept / Approach:
Standard C allows a struct member to be another struct type by value. This is a straightforward inclusion where the outer struct contains the entire inner struct as a sub-object. Self-embedding by value is not allowed because it would make the size infinite, but nesting different struct types (or the same via pointers) is fine.
Step-by-Step Solution:
Verification / Alternative check:
Compilers handle nested structs routinely; accessing fields uses dot chaining like p.addr.pin.
Why Other Options Are Wrong:
Common Pitfalls:
Trying to embed a struct inside itself by value (invalid). Use a pointer for self-reference instead.
Final Answer:
Correct
Discussion & Comments