< previous page page_225 next page >

Page 225
Hour 15
Arrays
In previous chapters, you declared a single int, char, or other object. You often want to declare a collection of objects, such as 20 ints or a litter of CATs. Today, you learn
· What arrays are and how to declare them
· What strings are and how to use character arrays to make them
· The relationship between arrays and pointers
· How to use pointer arithmetic with arrays
What Is an Array?
New Term: An array is a collection of data storage locations, each of which holds the same type of data. Each storage location is called an element of the array.
New Term: You declare an array by writing the type, followed by the array name and the subscript. The subscript is the number of elements in the array surrounded by square brackets. For example,
long LongArray[25];

 
< previous page page_225 next page >

If you like this book, buy it!