ABSTRACT

It is a mistake to try to look too far ahead. e chain of destiny can only be grasped one link at a time.

SIR WINSTON CHURCHILL

. . . is the sort of person who keeps a list of all of his lists.

ANONYMOUS

CONTENTS 15.1 Pointers and Indirection 594 15.2 Run-Time Arrays 605 15.3 Introduction to Linked Lists 610 15.4 e STL list<T> Class Template 613 15.5 Pointers and Command-Line Arguments 620 Chapter Summary 625 Test Yourself 628 Exercises 630 Programming Problems 634

In Chapter , we saw two dierent data structures that C++ provides for storing sequences of values: arrays and vector<T>s. One signicant dierence between these two kinds of objects is the way in which they are dened. For the kind of arrays we considered, their capacities must be specied at compile time as in the following declaration of anArray:

While a vector<T> object can be dened in a similar way,

its capacity can also be specied at run time

is is a basic dierence between the two kinds of objects: an array’s storage is determined (and is xed) when the program is compiled, but the storage of a vector<T> object is determined (and can change) while the program executes. e string class is similar to vector<T> in that a string object’s storage automatically adjusts to the number of characters being stored.