Professional Documents
Culture Documents
Union and Enum: Md. Ja K A Ria Lectu Rer de Pt. O F Cse, Mist
Union and Enum: Md. Ja K A Ria Lectu Rer de Pt. O F Cse, Mist
MD. JAKARIA
LECTURER
D E P T. O F C S E , M I S T
Union
o A different type of structure.
o A single piece of memory shared by two or more
variables.
o Variables maybe of different types.
o Only one variable maybe in use at a time.
Union
Stores different data types in the same memory location.
Union
Stores different data types in the same memory location.
Union
Stores different data types in the same memory location.
Union
Union
Enum
o Enumeration (enum) is a user-defined datatype.
o An enumeration consists of integral constants.
o Mainly used to assign names to integral constants
o To define an enumeration, keyword enum is used.