Structure, Union & Enumeration Introduction

We have studied before about the array, which is a collection of elements of the same data type. In this chapter, we shall discuss the structure, in which the individual elements can differ in type. There are various points of similarity and dissimilarity between structures and arrays. The structures and arrays are different from each other on the basic of two main points. Firstly, array is a collection of homogeneous i.e., same type of elements, whereas, structure is a collection of heterogeneous i.e. different type type of elements, secondly, an array element is referred by its position, whereas, each element/ component of structure has a unique name. the point on which the array and structures can be similar is that both array and structure must be defined with a definite number of components.

The following are the varieties of complex data types

  • Structure - The structure, which is a grouping of variables under one name and is called an aggregate data type
  • Union - In union same piece of memory is shared by all the numbers
  • Enumeration - The enumeration, which is a list of named integer constants.
  • Bit field - The bit field, which is a special type of structure or union element that allows easy access to individual bits.


About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext