Array & Structure Comparison in C

In C programming, an array is collection of homogeneous elements while structure is collection of heterogeneous elements.

In this article we are going to compare array and structure with their differences and similarities.

Array is collection of homogeneous elements i.e. of similar data types.
Structure is collection of heterogeneous elements i.e. of different data types.

Array uses index or subscript for accessing array elements.
Structure uses dot (.) operator for accessing structure elements.

Accessing array elements takes less time.
Accessing structure elements takes more time.

Array can be declared as:

int a[100];
Structure can be declared as:

struct book
{
   int pages;
   float price;
};