--:--









Quiz for Nested structures

Course: C Language | Subject: Unit 7 | Topic: Structures and Unions



Logo

Q1: What is a nested structure in C?

Logo

Q2: How do you access a member of a nested structure?

Logo

Q3: Given "struct Point { int x; int y; }; struct Rectangle { struct Point p1, p2; } rect;", how to access x of p1?

Logo

Q4: Can nested structures contain further nested structures?

Logo

Q5: How do you declare a pointer to a nested structure member?

Logo

Q6: Which operator accesses members through a pointer to nested structure?

Logo

Q7: If "struct Rectangle *rptr = ▭", how to access x of p2?

Logo

Q8: Can you assign one nested structure member to another?

Logo

Q9: What is the size of a nested structure?

Logo

Q10: Can nested structures be initialized directly?

Logo

Q11: Example of nested structure initialization:

Logo

Q12: Which of the following is valid to access nested structure member via pointer?

Logo

Q13: What does this expression mean: "rect.p1.x"?

Logo

Q14: Can nested structures contain arrays?

Logo

Q15: What will happen if you assign a nested structure directly?

Logo

Q16: How to declare a typedef for a nested structure "Point"?

Logo

Q17: Which is the correct way to pass a nested structure to a function?

Logo

Q18: Can you use a pointer to a nested structure member?

Logo

Q19: How to print nested structure member "x" in rect.p1 using printf?

Logo

Q20: What is a common use case of nested structures?

Are you ready to start test? Set your time limit