Declaration of unions — Study Resources & PYQs
Definition and declaration of unions for storing different data types in shared memory.
- Estimated study time: 30 minutes
Study resources
- Structures and Unions section - GeeksforGeeks tutorial (Article) — Covers struct declaration, initialisation, the dot operator, nested structures and arrays of structures, then unions and enums in the same section.
- C Unions - Programiz (Article) — Explains that all union members share the same memory, so only one holds a valid value at a time. The struct-versus-union memory size comparison is a guaranteed exam question.
Taught in these subjects
- COMPUTER PROGRAMMING — CST3101 · Government College of Engineering and Technology, Jammu