A vector is a container that holds multiple values of the same type, like an array. The difference: vectors resize automatically when you add or remove elements. Behind the scenes, vectors manage memory for you.
When you add an element and run out of space, the vector allocates more and copies your data. You never see this happen. Think of a vector as a smart array. It knows its own size, grows when needed, and cleans up its memory when destroyed.
Safer and more flexible than raw arrays.