CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

A union consists of a number of elements that

A
all occupy the same space in memory
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
must be structures
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
are grouped next to each other memory
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
all of the above
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A all occupy the same space in memory

A union consists of a number of elements that all occupy the same space in memory.

A union is a value that may have any of several representations or formats within the same position in memory; or it is a data structure that consists of a variable that may hold such a value. Some programming languages support special data types, called union types, to describe such values and variables.

A union is a special data type available in C that allows storing different data types in the same memory location. We can't use more than one member at a time. We can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory location for multiple-purpose.


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Process Of Recombinant DNA Technology
BIOLOGY
Watch in App
Join BYJU'S Learning Program
CrossIcon