Summary

Section 7.1 Introduction

  • Data structures (p. 284) are collections of related data items. arrays (p. 284) are data structures consisting of related data items of the same type. arrays are “static” entities in that they remain the same size throughout their lifetimes.

Section 7.2 arrays

  • An array is a consecutive group of memory locations that share the same type.

  • Each array knows its own size, which can be determined by calling its size member function (p. 285).

  • To refer to a particular location or element in an array, we specify the name of the array (p. 285) and the position number of the particular element in the array.

  • A program refers to any one of an array’s elements by giving the name of the array followed by the index

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.