Chapter     14

STL Array and Vector

You saw in Chapter 13 that the STL provides different types of string classes by specializing a template to create different implementations. This is where the template part of the STL comes from. The STL string classes are what we call containers, because they store string data. In this chapter you will see two more of the STL’s containers in the array and vector templates.

STL’s array class can be used in place of the built-in array types that you have seen earlier in this book. This allows you to use arrays in the same way you would use other STL containers; for example, the STL array template provides iterator access to the array elements. The size of an STL array is still determined at compile time. Sometimes ...

Get Learn C++ for Game Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.