Vectors (vector)
Flexible arrays: traversing with push_back, size, [] and range-for.
Simple enough for a 5-year-old to understand
create vector and add
Arrays are fixed-size; vector is used for a list that can grow (requires <vector>).
#include <iostream>#include <vector>using namespace std;int main() { vector<int> v = {1, 2}; v.push_back(3); cout << v[0] << " " << v.size() << endl; return 0;}