Types of Arrays in C
A list of related values stored in RAM is called an array. In C, there are two types of an array that exists:
- One-Dimensional Array
- Two-Dimensional Array
One-Dimensional Array:
Values in a mathematical set are written as shown below:
a={5, 7, 9, 4, 6, 8}
These values are referred to in mathematics as follows:
a0, a1, a2
In C, these numbers are represented as follows:
a[0], a[1], a[2]
these values are stored in RAM as follows:
Two-Dimensional Array:
These values are referred to in mathematical as follows:
A0,0 A0,1 A0,2
In C language, they are represented as follows:
a[0][0] a[0][1] a[0][2] and so on
It may be imagined that these values are stored in RAM as follows :