Objectives
In this chapter you’ll:
• Use C++ Standard Library class template array
—a fixed-size collection of related data items.
• Use array
s to store, sort and search lists and tables of values.
• Declare array
s, initialize array
s and refer to the elements of array
s.
• Use the range-based for
statement.
• Pass array
s to functions.
• Declare and manipulate multidimensional array
s.
• Use C++ Standard Library class template vector
—a variable-size collection of related data items.
7.4.1 Declaring an array
and Using a Loop to Initialize the array
’s Elements
7.4.2 Initializing an array
in a Declaration with an Initializer List
7.4.4 Summing the Elements of an array
7.4.5 Using Bar Charts to Display array
Data Graphically
7.4.6 Using the Elements of an array
as Counters
7.4.7 Using array
s to Summarize Survey Results
7.4.8 Static Local array
s and Automatic Local array
s
7.6 Case Study: Class GradeBook
Using an array
to Store Grades
7.7 Sorting and Searching array
s
7.9 Case Study: Class GradeBook
Using a Two-Dimensional array
7.10 Introduction to C++ Standard Library Class Template vector