A one-dimensional array in C contains a series of elements of the same datatype.
The elements are zero-indexed, meaning the first element is in position or index 0, and the last element is in position or index (array size) - 1.
Declaration of one dimensional array
To declare a one-dimensional array in C, you specify the data type of the elements and the name of the array followed by the size of the array in square brackets.
Here's a basic example:
Program.c
In the above example, numbers is an integer array with a size of 5, and initializedArray is another integer array initialized with specific values.
Remember that the size of the array determines how many elements it can store.
The indices of the array range from 0 to size-1.
Resources :
Test Your Knowledge
Choose The
With supporting text below as a natural lead-in to additional content.