C ARRAYS

What is an array?

An array is a sequence of values of the same type stored in contiguous memory locations. It is protyped like:

type name[size]

The <type_name> can be like:

int numbers[size]

char characters[size]

float values[size]

So, arrays:

Then:

Elements contains size - 1, because if i would do:

int numbers[2] {

numbers[0] = ‘0’;

numbers[1] = ‘1’; }

Whenever i try to acess <numbers[2]> like it has been protyped, it will get undefined behavior, because the index [2] does not exist. So the first element of any array it will always be arr[0].

Initialization

Just declaration:

Total initialization