Home / Questions / What is an Array?
Explanatory Question

What is an Array?

👁 764 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

An Array can be defined as a data structure having fixed size sequenced collection of elements of same data type and which can be referenced through the same variable name. An Array is a name given to a group of similar quantities.

Declaring an array

Type variable_name [length of array];

For example:-

double height[10];
float width[20];
int min[9];
int myArray[5] = {1, 2, 3, 4, 5}; //declare and initialize the array in one statement

In C language array starts at position 0. C language treats array name as the pointer to the first element and an item in the array can be accessed through its index.