Chapter 4. Arrays and Pointers
CONTENTS
Section 4.2 Introducing Pointers 114
Section 4.3 C-Style Character Strings 130
Section 4.4 Multidimensioned Arrays 141
The language defines two lower-level compound types—arrays and pointers—that are similar to vector
s and iterators. Like a vector
, an array holds a collection of objects of some type. Unlike vector
s, arrays are fixed size; once an array is created, new elements cannot be added. Like iterators, pointers can be used to navigate among and examine the elements in an array.
Modern C++ programs should almost always use vector
s and iterators in preference to the lower-level arrays and pointers. Well-designed programs use arrays and ...
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.