Chapter 3. Library Types

CONTENTS

Section 3.1 Namespace using Declarations 78

Section 3.2 Library string Type 80

Section 3.3 Library vector Type 90

Section 3.4 Introducing Iterators 95

Section 3.5 Library bitset Type 101

Chapter Summary 107

Defined Terms 107

In addition to the primitive types covered in Chapter 2, C++ defines a rich library of abstract data types. Among the most important library types are string and vector, which define variable-sized character strings and collections, respectively. Associated with string and vector are companion types known as iterators, which are used to access the characters in a string or the elements in a vector. These library types are abstractions of more primitive types—arrays and pointers—that are ...

Get C++ Primer, Fourth 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.