×
☰ Menu

Array in C

 

Arrays a kind of data structure that can store a fixed-size sequential collection of elements of the same data type. 

Although an array is used to hold data, it is often more beneficial to consider of it as a collection of variables of the same type. Arrays use contiguous memory locations.

Some examples where the concept of an array can be used:
  • List of temperatures recorded every hour in a day, or in a month
  • List of employees in an organization.
  • List of products and their cost by store
  • A test score of a class of students.
  • List of customers and their telephone numbers
  • Table of daily rainfall data.

 

Arrays use contiguous memory locations.

The first element is represented by the lowest address, while the last element is represented by the highest address.

 

 

We can use arrays to represent not only a simple list of values but also tables of data in two, three, or more dimensions.

Type of Arrays

  • One Dimensional array
  • Two Dimensional array
  • Multidimensional array