June 2025
Intermediate to advanced
1093 pages
33h 24m
English
Let’s walk through the sequential container classes (see Table 24.4):
array<ElementType,Size>A fixed number of elements is stored here. Adding and removing is only possible by overwriting. The elements are stored directly next to each other in memory. Therefore, array is suitable for both a few huge and many tiny element types, as it has virtually no memory overhead.
Figure 24.2 An “array” can neither grow nor shrink, but it is compact.
vector<ElementType>This all-rounder grows automatically. You can insert anywhere, but efficiently only at the back end.
Figure 24.3 Schematic representation ...
Read now
Unlock full access