To do just about anything of interest in a program, we need a group of data to work with.

For example, our program might need:

  • A list of Twitter’s trending tags
  • A set of payment options for a car
  • A catalog of eBooks read over the last year

The need for storing a collection of data is endless.

We are familiar with data types like int and double, but how do we store a group of ints or a group of doubles?

In this lesson, we will start with one of the simplest, and arguably the most useful, ways of storing data in C++: a vector.

A vector is a sequence of elements that you can access by index.


Click Next to continue.

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?