Structures

A variable of a certain data type such as int or char can store only one element of that data type. An array, on the other hand, can store multiple elements of a fixed data type. An array, thus, allows a programmer to address a collection of similar elements by a single name, while also allowing him to address each of the elements by their index in the array.

Can we create a collection of data elements of various data types and refer to this collection by a single name? The answer to this question is 'yes' and this is possible by the use of structures. A structure allows you to make a collection of various elements of different data types and refer to them by a single name. A structure can contain arrays as well. Hence, a structure in some sense acts like a new data type which has multiple components of various other data types. So, it is possible to make an array of structure variables also.