7 Class Templates array
and vector
; Catching Exceptions
Objectives
In this chapter you’ll:
Use C++ Standard Library class template
array
—a fixed-size collection of related data items.Declare
array
s, initializearray
s and refer to the elements ofarray
s.Use
array
s to store, sort and search lists and tables of values.Use the range-based
for
statement.Pass
array
s to functions.Use C++ Standard Library function
sort
to arrangearray
elements in ascending order.Use C++ Standard Library function
binary_search
to locate an element in a sortedarray
.Declare and manipulate multidimensional
array
s.Use one- and two-dimensional
array
s to build a real-worldGradeBook
class.Use C++ Standard Library class template
vector
—a variable-size collection ...
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.