This chapter began our introduction to data structures, exploring the use of arrays and vectors to store data in and retrieve data from lists and tables of values. The chapter examples demonstrated how to declare an array, initialize an array and refer to individual elements of an array. We also illustrated how to pass arrays to functions and how to use the const qualifier to enforce the principle of least privilege. Chapter examples also presented basic searching and sorting techniques. You learned how to declare and manipulate multidimensional arrays. Finally, we demonstrated the capabilities of C++ Standard Library class template vector, which provides a more robust alternative to arrays.
We continue our coverage of data structures in Chapter 14, Templates, where we build a stack class template and in Chapter 21, Data Structures, which introduces dynamic data structures, such as lists, queues, stacks and trees, that can grow and shrink as programs execute. Chapter 23, Standard Template Library (STL), introduces several of the C++ Standard Library's predefined data structures, which programmers can use instead of building their own. Chapter 23 presents the full functionality of class template vector and discusses many additional data structure classes, including list and deque, which are array-like data structures that can grow and shrink in response to a program's changing storage requirements.
We have now introduced the basic concepts of classes, objects, control statements, functions and arrays. In Chapter 8, we present one of C++'s most powerful featuresthe pointer. Pointers keep track of where data and functions are stored in memory, which allows us to manipulate those items in interesting ways. After introducing basic pointer concepts, we examine in detail the close relationship among arrays, pointers and strings.