Skip to content

Many values in one place

Read · 1 of 4

A row of numbered boxes

vector<int> marks = {70, 85, 60}; makes one variable holding three ints. Add #include <vector> at the top.

Each value has a position, starting at 0: marks[0] is 70, marks[2] is 60. marks.size() is how many there are.