Summary
An array is a set of elements that all have the same data type. Array elements are stored sequentially in memory and are accessed by using an integer index (or offset). In C, the first element of an array has an index of 0, so the final element in an array of n elements has an index of n - 1. It's your responsibility to use array indices that are valid for the array, because neither the compiler nor the running program checks.
To declare a simple one-dimensional array, use this form:
type name[size];
Here, type is the data type for each and every element, name is the name of the array, and size is the number of elements. Traditionally, C has required that size be a constant integer expression. C99 allows you to use a non-constant integer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access