Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
C++ Fundamentals

You're reading from   C++ Fundamentals Hit the ground running with C++, the language that supports tech giants globally

Arrow left icon
Product type Paperback
Published in Mar 2019
Publisher
ISBN-13 9781789801491
Length 350 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
 Mallia Mallia
Author Profile Icon Mallia
Mallia
 Zoffoli Zoffoli
Author Profile Icon Zoffoli
Zoffoli
Arrow right icon
View More author details
Toc

Table of Contents (8) Chapters Close

About the Book 1. Getting Started FREE CHAPTER 2. Functions 3. Classes 4. Generic Programming and Templates 5. Standard Library Containers and Algorithms 6. Object-Oriented Programming 1. Appendix

Sequence Containers

Sequence containers, sometimes referred to as sequential containers, are a particular class of containers where the order in which their elements are stored is decided by the programmer rather than by the values of the elements. Every element has a certain position that is independent of its value.

The STL contains five sequence container classes:

Figure 5.1: Table representing the sequence container class and their description
Figure 5.1: Table presenting the sequence container classes and their descriptions

Array

The array container is a fixed-size data structure of contiguous elements. It recalls the static array that we saw in Chapter 1, Getting Started:

Figure 5.2: Array elements are stored in contiguous memory
Figure 5.2: Array elements are stored in contiguous memory

An array's size needs to be specified at compile time. Once defined, the size of the array cannot be changed.

When an array is created, the size elements it contains are initialized next to each other in memory. While elements cannot be added or removed, their values can be modified.

Arrays can be...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images