Arrays
Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value.
To create an array, define the data type (like int
) and specify the name of the array followed by square brackets [].
To insert values to it, use a comma-separated list inside curly braces, and make sure all values are of the same data type:
int myNumbers[] = {25, 50, 75, 100};
We have now created a variable that holds an array of four integers. Continue reading C Arrays