I'm AlanWu. When I started C++, my answer to "I need to store multiple things" was always an array. int arr[1000]. Every time.

Then I discovered the STL containers and realized I'd been working way too hard. Here's when to use what.

vector — your new default

If you used to write int arr[1000], use vector<int> arr instead. It grows, it shrinks, it knows its own size, and you can pass it to functions without also passing the length separately.

// Old way