Chapter 2. vector and string

All the STL containers are useful, but if you’re like most C++ programmers, you’ll find yourself reaching for vector and string more often than their compatriots. That’s to be expected. vector and string are designed to replace most applications of arrays, and arrays are so useful, they’ve been included in every commercially successful programming language from COBOL to Java.

The Items in this chapter cover vectors and strings from a number of perspectives. We begin with a discussion of why the switch from arrays is worthwhile, then look at ways to improve vector and string performance, identify important variations in string implementations, examine how to pass vector and string data to APIs that understand only ...

Get Effective STL 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.