7. Class Templates array and vector; Catching Exceptions

Now go, write it before them in a table, and note it in a book.

—Isaiah 30:8

Begin at the beginning, ... and go on till you come to the end: then stop.

—Lewis Carroll

To go beyond is as wrong as to fall short.

—Confucius

Objectives

In this chapter you’ll:

• Use C++ Standard Library class template array—a fixed-size collection of related data items.

• Use arrays to store, sort and search lists and tables of values.

• Declare arrays, initialize arrays and refer to the elements of arrays.

• Use the range-based for statement.

• Pass arrays to functions.

• Declare and manipulate multidimensional arrays.

• Use C++ Standard Library class template vector—a variable-size collection of related data ...

Get C++ How to Program, Ninth Edition 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.