Arrays of variables can be defined using the notation name[size]
, where name
is the
variable name and size
is an integer that
defines the number of elements in the array. The index of a C array
always begins at .
Arrays of variables can be of different data types as shown
below.
int a[10], b[10][10];
real radii[5];
a[0] = 1; /* a 1-Dimensional array of variable a */
radii[4] = 3.14159265; /* a 1-Dimensional array of variable radii */
b[10][10] = 4; /* a 2-Dimensional array of variable b */