We have already seen how a structure is a grouping of one or more components that can eachbe of different data types. Often, we need a grouping that consists of the same type; this is called anarray. An array is a collection of multiple occurrences of the same data type grouped together under a single name. Each element of the array is accessed via its basename and an offset of that base. Arrays have many uses, from organizing homogenous data types to providing the basis for strings, or arrays of characters.
Before we can learn about some of the wide uses of arrays, we need to explore the basics of declaring and manipulating arrays.
The following topics will be covered in this chapter:
- Declaring an array of values
- Initializing an array in several ways
- Accessing each element of an array
- Understanding zero-based array indexing
- Assigning...