Lessons
C++ · Bigger Programs · 27. Vectors

step 1 of 7

A list that grows

A vector is a list that grows. It starts empty, and push_back adds one value at the end.

v.size() tells you how many are inside.

Mission

Push 40 as well, then RUN. What is the size now?

PIP·1
main.cppyour code
1
2
3
4
5
6
7
8
9
10
11
12
← press me!
readyscreen

Press RUN to see what this program does.

Do the mission and Next turns green.

Vectors