--:--









Quiz for Unions definition and usage

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



Logo

Q1: What is a union in C?

Logo

Q2: What is the size of a union?

Logo

Q3: How do you define a union named "Data"?

Logo

Q4: Can union members be accessed like struct members?

Logo

Q5: What happens if you assign value to multiple union members?

Logo

Q6: Which use case is typical for unions?

Logo

Q7: Can a union contain other unions?

Logo

Q8: Is it legal to define pointers to unions?

Logo

Q9: How to declare a variable "d" of union Data?

Logo

Q10: Which of these operators accesses union members?

Logo

Q11: Can unions have member functions?

Logo

Q12: Are unions useful for type punning?

Logo

Q13: Can you use sizeof on a union variable?

Logo

Q14: How many members can a union hold at the same time?

Logo

Q15: What happens if you read a different member than last written?

Logo

Q16: Can unions have bit-fields?

Logo

Q17: Can unions be initialized at declaration?

Logo

Q18: Is it possible to assign one union variable to another?

Logo

Q19: What is a common application of unions in embedded systems?

Are you ready to start test? Set your time limit