Chapter 7. Arrays and Vectors

 

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 learn:

  • To use the array data structure to represent a set of related data items.

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

  • To declare arrays, initialize arrays and refer to the individual elements of arrays.

  • To pass arrays to functions.

  • Basic searching and sorting techniques.

  • To declare and manipulate multidimensional arrays.

  • To use C++ Standard Library class template vector.

Outline

7.1

Introduction

7.2

Arrays

7.3

Declaring Arrays

7.4

Examples Using ...

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