What is an Array?

Long Answer
Views 762

Answer:

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.

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Data Structure, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.