ABSTRACT

This chapter discusses a new type of variable capable of storing a number of values. This type is called array. An array may be multidimensional. The chapter focuses on the simplest and most usual kinds: the one-dimensional and two-dimensional arrays. It shows that how to use arrays of integers and floating-point numbers. The chapter discusses other types of arrays, as well as their close relationship to pointers. An array is a data structure that contains a number of values, or else elements, of the same type. Each element can be accessed by its position within the array. When a two-dimensional array is declared, the number of columns must be specified. However, the number of rows is optional. If it is not specified, the compiler will create a two-dimensional array based on the initialization list. To declare a two-dimensional array, must specify its name, its data type, and the number of its rows and columns.