Store multiple values in a single variable.
In this video the explanation regarding how to work with single
dimensional array has been described. How to declare, Initialize and use
the array has been explained with the help of example.
An array in C is a fixed-size collection of similar data items that are stored
in contiguous memory locations. It can be used to store both primitive and
derived data types. Primitive data types such as int, char, float etc. and
derived data types such as pointers, structures etc. .
Access of an element of an Array
To access an array element, refer to its index number.
Array indexes start with 0: [0] is the first element. [1] is the second element,
etc.
This statement accesses the value of the first element [0] in myNumbers:
int myNumbers[] = {25, 50, 75, 100};
printf("%d", myNumbers[0]);
To change the value of a specific element, refer to the index number:
my Numbers[0] = 33;